Hi,
I am struggling with a problem for several days now and I wonder if anyone has a bright idea :
I have a field on a form that has a value list attached containing two fields :
(person_id (stored) , person_name (displayed))
But : I want the value list to be different for browse+find versus new+add mode
In new+add mode the list should contain a subset of all values.
In browse+find mode the list should contain all values.
(The subset (limited list) should contain only values that are actual (for instance only currently employed salesmen) and are related to another field in the same table (for instance only salesman for a specific business unit))
The complete set (all list) should contain all values so you can search on a salesman that is no longer employed and for whom you do not know the business unit.
I only want the limited list to be activated when the user selects the combobox.
In all other situations the all list should be active.
I tried several scenarios and will explain two of them here:
-
using two fields with the same dataprovider, one with the all list attached and one with the limited list attached.
Setting one field visible/one field invisible depending on the mode.
This will not work if you want the limited list to be applied when the user selects the combobox.
You would have to use the onFocusGained/Lost events to change the visible field, which is a difficult/strange combination (focus and visible) -
using one field with an empty value list attached.
Creating two datasets and attach the correct dataset to the value list depending on the mode.
This can also be done in an onFocusGained/Lost event.
Is the second the best way or is there another way to do this ?
I hope this makes sense, it is rather complex and hard to explain.
Regards,