why the add/romoveOptions is working in catalog form but not on RITM & SC Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 01:37 PM
Hi,
I have a requirement that based on option1 in one variable, the other variable should only display V1&V2. If i select option2 then other variable should only display V3&V4. i have written on change client script and it is behaving as expected in service portal. But the problem is the script is not working on RITM and SC Task variables eventhough i Checked applies on RITM & task checkboxes. the second variable is showing all the options in it. any suggestion is helpful and appreciates. Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 01:59 PM
removing an option from the variable will only work on a select box type variable not multiple choice.
Please be kind enough to mark my answer correct and Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 03:21 AM
HI Amrit,
The variables that i created are select box only. not multiple choice variable. you can have a look on the screenshot added to the question. the Versino & Select version variables are select box only.
Thanks,
Siva.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 03:29 AM
Try to change your script exactly like below using your variable and options. See if it works
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
addOptionAll();
g_form.addOption("select_the_required_role", "", "--None--", "0");
return;
}
addOptionAll();
g_form.addOption("select_the_required_role", "", "--None--", "0");
if (newValue == "AS1" || newValue == "AS2" || newValue == "AS3" || newValue == "AS5") {
g_form.removeOption("select_the_required_role", "scbgrpthres");
g_form.removeOption("select_the_required_role", "amanalyst");
g_form.removeOption("select_the_required_role", "aminauditrgrp");
g_form.removeOption("select_the_required_role", "amsupvisrgrp");
} else if (newValue == "AS4") {
g_form.removeOption("select_the_required_role", "exlupldadmn");
g_form.removeOption("select_the_required_role", "scbgrpthres");
} else if (newValue == "STH1" || newValue == "STH2" || newValue == "STH3" || newValue == "STH4" || newValue == "STH5") {
g_form.removeOption("select_the_required_role", "exlupldadmn");
g_form.removeOption("select_the_required_role", "amanalyst");
g_form.removeOption("select_the_required_role", "aminauditrgrp");
g_form.removeOption("select_the_required_role", "amsupvisrgrp");
}
function addOptionAll() {
g_form.clearOptions("select_the_required_role");
g_form.addOption("select_the_required_role", "exlupldadmn", "EXLUPLDADMN", "1");
g_form.addOption("select_the_required_role", "scbgrpthres", "SCBGRPTHRES", "2");
// g_form.addOption("select_the_required_role", "amanalyst", "AMANALYST3GRP", "3");
// g_form.addOption("select_the_required_role", "aminauditrgrp", "AMINAUDITRGRP", "4");
// g_form.addOption("select_the_required_role", "amsupvisrgrp", "AMSUPVISRGRP", "5");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 04:01 AM
As it is on chnage script it is working fine in portal. To make it work on RITM and sc task you have to write script onload of the form as well.
in the same client script
if(isLoading||newvalue=='')
{
copy your code here as well.
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful