Unable to remove subcategory choice value based on category choice value selection.

mmr
Tera Contributor

We are trying to remove choice value(ex: test) from subcategory when we select a choice value(ex: test1) on Category field. We have tried with onChange client script by using the g_form.removeOption method, but it is not working as there was already a dependent checkbox checked for the subcategory field in the dictionary.

Any suggestion would be helpful for us.

14 REPLIES 14

mmr
Tera Contributor

Thank you for your reply. But here we can't remove all options and add it through addoption because these choices should be there in the list. When we create a ticket from portal, then it should create ticket with those choices, but when we open the form directly at the backend to create ticket, then we want to remove some choices in the subcategory.

I think i got your issue now, the thing you are asking is after the user submits the request

then hide those options which are irrelevant to the choices. 

Even I encountered the same issue .

 

I think there is no solution for that problem currently , the only thing you can do is

check THE details under Variables section rather than checking the values in Description.

 

And for getting all the variables under variables section you need to check the Global option.

 

Mark my ANSWER as CORRECT n also HELPFUL if it helped.

Sajilal
Mega Sage

1) Check in Choice List table whether Dependent field is updated, if yes then clear it

2) Work with your client script to clear and addOption methods to populate the Dropdowns

Kindly mark correct or helpful if it helps you to solve your problem

Regards,
Sajilal

Rafiuddin1
Tera Contributor

If you got the answer, please do share it.

JB6
Tera Contributor

Currently trying to make this happen as well. The clearOptions() function works on the Category field, and it seems to work on Subcategory, but then something looks to be taking precedence and repopulating the choices.  I've tried this with both a Client Script and a UI policy.  The UI policy seems to be the better option, but I still haven't found what is making the options repopulate.