Jump to content

get value list second field value?


radical

This topic is 5563 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

i have created a drop-down list with the first field hidden and the second shown. the hidden field is a key. id and label. (using it like an array)

the drop-down is for a field of a child table of that sits on the parent layout in a portal. the drop-down value list is not related to the parent or child record.

in a script I need to get the second field based on the first field.

i looked at getnthrecord, but I need to get by key not record number.

anyone have any ideas? thanks

Link to comment
Share on other sites

This is not entirely clear. Are you selecting a specific child for a parent? If so, the easiest way to get data from the selected child would be to establish a second relationship to the child table, matching the selected key.

You COULD use GetNthRecord() instead, provided that:

(a) your existing relationship is sorted by the second field of your value list; and

(: your value list is filtered by the relationship; and

© the second field contains only unique values.

Under these conditions, the index position of the selected key in ValueListItems() will be also the N required for the GetNthRecord() function. Otherwise you'll need to grab the selected key and do a find for it in the child table.

Link to comment
Share on other sites

  • Newbies

thanks for the response.

here is some more info.

parent: contacts

child: phone numbers (has the label field)

value list: label (id, name) not related to either parent or child.

value list comes from a shared table with many lists not just the phone list, makes it easier for entering lists.

Link to comment
Share on other sites

Sorry, I don't quite follow what you wrote. You speak of a phone numbers table, but then there is "a shared table with many lists". It's not clear if they are the same, and I am not at all sure what you mean by "many lists".

In any case, I think I have already answered the question - there is no way to get the "second field" value directly from the drop-down field. You must have a list of the "label" values that corresponds exactly to the list of "id" values, as produced by your value list.

Link to comment
Share on other sites

This topic is 5563 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.