- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:46 PM
I want to hide 'SAP / Application Problem' from showing up in the incident drop down for the Category field if you don't have the 'admin' or 'iGate' roles. The value for SAP / Application is 'sap_application_support'. I'm trying to use a client script on Load to remove this value. The script that is not working is below...I'm still learning how to use Javascript and have only been involved in using SNOW for about 6 months. Any help is greatly appreciated in advance...thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:51 PM
You don't have to explicitly call admins if you use hasRole. admins automatically have every role. If you use hasRoleExactly, you would. So, I would do:
if(!g_user.hasRole('iGate')){
g_form.removeOption('category', 'sap_application_support');
}
and that should suffice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:50 PM
So close!
Your script should read:
function onLoad(){
if (!g_user.hasRole('admin') && !g_user.hasRole('iGate')){
g_form.removeOption('category', 'sap_application_response');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 01:13 PM
Awesome this worked perfectly! Thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 01:14 PM
Thanks for the help Mike this works as well! Awesome!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2015 12:51 PM
You don't have to explicitly call admins if you use hasRole. admins automatically have every role. If you use hasRoleExactly, you would. So, I would do:
if(!g_user.hasRole('iGate')){
g_form.removeOption('category', 'sap_application_support');
}
and that should suffice.