By default, a picklist field of type "Lookup", will display all the values present in the lookup field. The deluge ui.add / ui.append task is used in on user input field action script and on load form action script, to add an item to a picklist / radio button / checkbox / multiselect lookup field. For example, in the SubmitFeedback form given below, each issue submitted is assigned to a specific team member belonging to a specific module. When a Module is selected from the Module Name picklist, only those team members belonging to the selected module will be listed in the Assign To picklist. This is achieved using the <picklist fieldname>:ui.add(value) Deluge syntax.
Alternatively, you can also specify the Deluge criteria in the Set Criteria option of the lookup field, to create dynamic picklist.
Use the following syntax to add items to a picklist within a Normal form :
Below is an example code that should be specified in the onUserInput action of Form field to create a dynamic picklist.
statelist = State [Country_Name == input.Country] sort by State_Name;
Use the following syntax to add items to a picklist within a subform:
row.<picklist field>:UI.append(<LIST VARIABLE>/<STRING VARIABLE>);
Below is an example code that should be specified in the onUserInput action of subform picklist field.
list = Product [Category == row.Category] sort by Product_Code ;
The UI.append task does not implicitly clear the old items and hence you need to explicitly invoke the clear task. If Items is a lookup or dropdown field and do not contain the value passed to the append task then the append operation will fail.
The sample application "Order Management" illustrates the subform feature.