setting the default of setValueListItems()

I’ve successfully set up the generation of a value list from an array by using “application.setValueListItems(vl_name, display, dataset)”. The value list is attached to a pop-up based on an integer field. It works, is fully functional, does what’s needed.

Its initial appearance to the user is blank, no value selected. Is it possible to set a default for this popup so the user has an obvious starting point? A step like "integer_field = ‘text display string’; " won’t work, wrong field type.

Is there a technique which will work?

Yes there is a technique: supply the right field type! So not “integer_field = ‘text display string’;” but “integer_field = integer_returned;”. If you want to display a value of your value list and your value list returns integers while it shows text you need to supply the field with an integer.

If your value list is

1 Apples
2 Peaches

and you put a 1 in the field, you see Apples.

If your value list contains

Apples
Peaches

you will have to put Apples in your field, if it is of type text, of course.

Patrick

Sometimes working out a problem just needs to let it go for a few hours. Then suddenly the solution appears while in the shower.

The solution to the above is to set the “integer_field” with the appropriate value it would have if and when the user uses the popup. Thus, if the value list will generate the value of 10 when choosing Apple and 20 if choosing Pear, then after the value list has been generated set the integer_field to 10 and Apple will appear.

Obvious, now that I think about it in the right way. Sometimes it just takes beating your head against a wall, followed by a good sleep and a shower in the morning. :D