limit the number of options on select box based on another variable value

Mohamed Taha
Tera Expert

I have a catalog item with set of variables 
we're concerned about two 
request_type which is a reference variable 
and a service_offering variable which is a select box with three options 
"add" , "update" , "remove"
what i want to do is to remove the option "remove" when the request type is one of two values 
I've uesd catalog client script to do this but nothing happen and the condition isn't evaluate to true


I've tried newValue.sys_id and newValue.getValue('sys_id') but nothing change
MohamedTaha_0-1728916420797.png

 

1 ACCEPTED SOLUTION

@Mohamed Taha 


Change the client UI Type to All

View solution in original post

6 REPLIES 6

Omkar Mone
Mega Sage

Hello,

 

Do you want to remove all the options or just 1 option out of 3? Your code above shows you are trying to remove all the options. If not, try with the removeOption method of g_form. If you are trying this on portal, as Eshwar suggested, change the type to All.

 

g_form.removeOption('your_field','backend_value_of_option');

 

it doesn't work if i make it to delete the whole options or just remove one option using removeOption() method