Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2022 10:57 AM
Hi Jacob,
You can use below change client script which will work both onChange and onLoad :- Remove choices as per your requirement.:- On Change of state
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
if (g_form.getValue('state') == 1) {
g_form.removeOption('state', '3');
g_form.removeOption('state', '6');
g_form.removeOption('state', '7');
g_form.removeOption('state', '8');
}
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 2) {
g_form.addOption('state', '1','New',1);
g_form.addOption('state', '2','In Progress',2);
g_form.addOption('state', '3','On Hold',3);
g_form.addOption('state', '6','Resolved',4);
g_form.addOption('state', '7','Closed',5);
g_form.addOption('state', '8','Canceled',6);
}
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Gunjan Kiratkar
Consultant - ServiceNow, Cloudaction
Rising Star 2022