Dynamic Drop Down(Translate Values)

Your rating: None Average: 4 (9 votes)

This code i have got Ittool box.com.
It is very useful. we usually have requirement when we want to hide some translate values from translate field on page for some business reason.
In this case we can use AddDropDownItem(),ClearDropDownItem().
The fact is that we need to use ClearDropDownItem() function first. so whatever values it had will be cleared out and then we will have to manually add values using AddDropDownItem().

Here is an example on the page activate PeopleCode.

Local Field &fField;

&fField = Record.EX_APR_WRK.APPROVAL_STATUS;
&fField.ClearDropDownList();
&fField.AddDropDownItem(" ", "All");
&fField.AddDropDownItem("A", "Approved");
&fField.AddDropDownItem("D", "Denied");
&fField.AddDropDownItem("H", "Hold");

I hope this will help everybody if needed.

Regards
Nitin Khanna

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
Guest's picture
Guest
Re: Dynamic Drop Down(Translate Values)

I tried this code but i am getting following error,Please help me out.by resolving this issue.
"cannot convert type string to object type field (180,604)".

Guest's picture
Guest
Re: Dynamic Drop Down(Translate Values)

May be field data type and translate values data type are different.So we need to convert the translate value data type.
example : if it need to convert to number dtatype through code :
&a= isnumber(field name);
then it will convert the field to number field.
i think it is workout.