Remove reference variable choices from dropdown for a catalog item. (out of 5 choices need to disable 3choice)

Mad3
Tera Expert

In "Action" variable set:
1. Update "Supported Business Unit" variable - keep choices "Consumer Healthcare" and "Global Support Functions" remove Pharma, Viiv, and Vaccines choices. 

* "Supported Business Unit" is a reference variable.

7 REPLIES 7

palanikumar
Giga Sage

Hi,

Can you clarify your requirement clearly. Do you want to remove them permanently? or dynamically based on other variable?

If permanent, then you can simply go to variable definition of the Select box and delete the unwanted choice in the related list below

If it is conditional then it should be done via Client Script. You can add below code in Client script to remove an option

g_form.removeOption('variable_name','choice_value','choice_label');

Thank you,
Palani

Hayo Lubbers
Kilo Sage

Hi,

 

You can do this with an onChange client script on your 'Supported Business Unit', by using the g_form.removeOption function.

Don't forget to re-add them again when another option is selected via the g_form.addOption function.

 

Another option is to use the UI Policy, executing a script on true/false. Condition can then be set via the condition builder.

function onCondition() {
	g_form.removeOption('<variable_name>','<value>');
}

and execute when false

function onCondition() {
	g_form.addOption('<variable_name>','<value>', 'displayValue');
}

 

Regards,

Hayo

Sunny Khandelwa
Kilo Guru

Hi,

As per best practice, it is not advisable to delete the choice, as it may be used in records.

To hide/disable the choice from the Reference field. You need to set the "Reference qualifier".


If it is a simple condition like active true. Then select the "Simple" & Build your condition.

find_real_file.png

If it is a bit complex & depends on some other variable. Then you have to define the javascript.

find_real_file.png

 

If the choice is based on some other conditions, then you can write a script include & call the same in Refrence Qualifier.

 

To hide/disable the choice from the Select Box or some other field. You can simply make the choice Inactive true & it's done. It will not be visible in the catalog item.

find_real_file.png

 

You can do the same by opening the choice you want to hide/disable >> Click on the Inactive checkbox & save. 

OR

You can do the same by list view also like in the above screenshot.

 

Regards,

Sunny Khandelwal

Please find attached file.