How to Configure Dependent Choice Lists

Richard101
Mega Expert

I need to make sure I'm understanding the wiki correctly.

I have Dropdown 1 (called State) that has 10 values (one being In use) and Dropdown 2 (called Purpose) that has 9 values (one being Production). I want the following:

  • All 9 values of Purpose to be available for all States except In use
  • The Purpose Production to be the only one available for In use State.

Do I need to make 18 choices to correctly configure the Dependent values? Then if I were to make a new State or Purpose value later I would need to add another dependent choice? Is there no "else" functionality on the dependent value? Is there a better way to do this with UI/Client scripts?

1 ACCEPTED SOLUTION

fkhan
Kilo Guru

Hi,


It can be done   by onChange client script on state Field


var state=g_form.getValue("state") ;


//if(state=='value of In Use state'){


if(state=='In Use'){


g_form.clearOption('purpose');


g_form.addOption('purpose','Production','Production');


//g_form.addOption('Field_name','Choice_value','Choice_label');


}


Thanks,


farukh


View solution in original post

2 REPLIES 2

Harsh Vardhan
Giga Patron

Hi Richadr,



You can either use "Dependent Field" functionality or write onChange() client script on State.



Please refer the link below.



Write Client scripts to update subcategory while selecting values in category field.



Regards,


Harshvardhan


fkhan
Kilo Guru

Hi,


It can be done   by onChange client script on state Field


var state=g_form.getValue("state") ;


//if(state=='value of In Use state'){


if(state=='In Use'){


g_form.clearOption('purpose');


g_form.addOption('purpose','Production','Production');


//g_form.addOption('Field_name','Choice_value','Choice_label');


}


Thanks,


farukh