January 29, 200916 yr 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
January 29, 200916 yr 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.
January 30, 200916 yr Author 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.
January 30, 200916 yr 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.
Create an account or sign in to comment