Is there any server side function add or remove choices from dropdown instead of g_form.addOption or g_form.removeOption?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2022 10:33 PM
The requirement is to add new subcategory on the basis of "assignment group=a" and "category=b" we should have "subcategory=ab" . Subcategory is dependent on category field. Using onChange client scripts gives partial solution not proper. So can I have any server side function to add or remove choices?
Using 2 Onchange client scripts, one for Assignment group and another for Category but isn't working properly
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(g_form.getValue("assignment_group")=="c6c828c453751300ba3dddeeff7b1219")
{
if(g_form.getValue("category")=="inquiry")
{
g_form.addOption("subcategory","email","Email");
}}
else{
g_form.removeOption("subcategory","email","Email");
}
//Type appropriate comment here, and begin script below
}
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2022 10:53 PM
Hi,
server side cannot add/remove options. It happens only on client side
If you are talking about incident form then subcategory is dependent on category so unless that category is there in option the subcategory won't be shown
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader