How to hide choices based upon condition in RITM and TASK.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2022 03:01 AM
Hi All, there is two fields 1.cap(Reference) and 2.non-cap (choices / options), whenever I select one value in 1.cap then the 2.non-cap some choice should be hide based upon condition on 1.cap, like whenever I select particular value in 1.cap then the some choices(options) should be hide in 2.non-cap field in RITM and task
Labels:
- Labels:
-
Service Catalog
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2022 04:01 AM
Hi There,
You can create an onChange client script here and can use the below code to make it work.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if(newValue=='sys_id of the selection in cap field');{
g_form.removeOption('non_cap field backend name','choice value you want to remove'); //write this code for all the choices you want to remove.
}
}
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)
Mohit Kaushik
ServiceNow MVP (2023-2025)