Drop Down lists

I am looking some for techniques to change the contents of a displayed drop down list without having to map option fields based upon other field. Example: By default the Sales Order Line Type field drop down list displays the following options: G/L Account Item Resource Fixed Asset Charge(Item) But based upon User Setup table we only want the user to enter Sales Lines with the following options Item Resource Charge(Item) The Sales Line Type list is filtered only to display the possible options wtih their options values (no mapping).

Hi Alan My suggestion: Put the following code into the Table 37 ‘Sales Line’ / field ‘Type’. Something like that: **Type - OnValidate()** IF Type=1 THEN ERROR('No'); *So the user get an error if he select G/L account.* **Better:** IF Type=1 THEN Type:=0; *The user get nothing if he select G/L account.* You can apply a ‘UserSetup.Get’ before to check the user. bye André

Customer wishes to change the drop down list not generate error messages.

I do not think it is possible to just change it. If the options are held in a variable on the form, you could switch between showing the 2 different controls using CurrForm..VISIBLE(BOOL). Selecting an option from these variables would validate the field with the appropriate option. To the end user, it would achieve the same result you described above. This is not an elegant solution, but it will probably work. If my explanations are not clear, let me know and I can draft up a sample. Form 5096 in Attain360 sorta does something similar with the 2 function buttons. Regards, Edward.

quote:


Originally posted by alanbutterfield
Customer wishes to change the drop down list not generate error messages.


My second suggestion (IF Type=1 THEN Type:=0;) doesn’t generate errors messages.

quote:


Originally posted by eddpeggs
If the options are held in a variable on the form, you could switch between showing the 2 different controls using CurrForm..VISIBLE(BOOL). Selecting an option from these variables would validate the field with the appropriate option. To the end user, it would achieve the same result you described above.


Place the type field on the form twice. Give them different names but give them both the caption “Type”. Modify the “ValuesAllowed” propertie per “type” field on the form. Show the right field for the right user by using this statement: CurrForm.[fieldname].VISIBLE := user.boolean;

Hi Emiel

quote:


Originally posted by eromein
… Modify the “ValuesAllowed” propertie per “type” field on the form. …


Cool hint! I just recognized the ‘ValuesAllowed’- property [:(]. @Allan: Emiels solution is much better then my suggestion. bye André