Catalog Client Script (Show the subcategory field only if you have an ITIL role)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 11:17 AM
Hi Pauline,
In the Catalog Client Script, you can use something like this without a Glide Ajax call in this case:
if (g_user.hasRole('itil')) {
g_form.addOption....
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 12:55 PM
Hi @PaulineCovely ,
Create Catalog Client script is an onChange of Category field.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var cat = g_form.getValue('category');
var subcat = g_form.getValue('sub_category');
if (cat == "IT Security" && (!g_user.hasRole('itil'))) {
alert("entered");
g_form.removeOption('sub_category', 'Security Exception');
//g_form.removeOption('sub_category','Security Exception','Security Exception');
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda