- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 01:18 AM
Hello Experts,
I have a request to show choice options based off of a selection made. I have a "requiring_admin_role_access" and "Duration of access" field (Both select box type field).
My requirement is : Show all choices of "Duration of access" when ""requiring_admin_role_access" is "Change_request".
And it should not show the "1 day, 3days, 5 days "option when other option(incident,problem,sc_request) is selected in ""requiring_admin_role_access".
I am using on change client script(attached) to remove the option, my issue that I am facing is I can remove the choices, but they do not get readded back if "Change request" in "requiring_admin_role_access" is selected.
What is the best way to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 01:43 AM
Hello,
Add the below code in your script.
if(role=='change_request')
{
g_form.addOption('duration_of_access','1_day','1_day');
}
Regards,
Namrata

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 01:40 AM
Hello @Prashant Kumar6 ,
In the script you need to also add the else condition and, in that condition, add the options you are removing.
g_form.addOption('contact_type', 'phone', 'Phone');
If this solves your problem, mark this as correct and helpful.
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2023 01:43 AM
Hello,
Add the below code in your script.
if(role=='change_request')
{
g_form.addOption('duration_of_access','1_day','1_day');
}
Regards,
Namrata