Getting a list variable to work in a script
Hello,
Was wondering if you could help me with how to set a variable derived from a list as a suffix on a field name, Below is my 1st attempt at scripting.
Basically I want to do the same If and else statement for three form fields. I thought I could use Custom function but it does not like the 'Clear' item in the if statement.
Child_option_1
Child_option_2
Child_option_3
//// Script
- optionno = {"1", "2", "3"};
- for each Option_var in optionno
- {
- if (count(Testform2[Parent_option == input.Product_Parent]) == 0)
- {
- set optionNo = "Child_option_"+Option_var;
- clear optionNo;
- }
- else
- {
- set optionNo = "Child_option_"+Option_var;
- rec1 = Testform2 [Parent_option == input.Parent_option] sort by Child_option ;
- optionNo:ui.add(rec1.Child_option.getall());
- }
- }
I have given you access to my application Test01 which is basic application that I use to teach myself deluge script syntax.
Thanks in advance for your help.