Hide an option from a choice list for ITIL users
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 07:23 AM
Hi,
Is it possible to hide an option from a choice list for ITIL users?
Lets say there are 4 options in a choice field and i want to hide the 3rd option for ITIL users, would that be achievable?
Labels:
- Labels:
-
Scripting and Coding
-
Team Development
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 07:29 AM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-06-2017 07:30 AM
Hi Amlesh,
Link https://www.servicenowguru.com/scripting/client-scripts-scripting/removing-disabling-choice-list-opt... should help.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2019 01:53 AM
Sure. This example works fine.
Create a new Client Script that runs onLoad
function onLoad() {
//who to display it for - admin
var isAdmin = g_user.hasRole('admin');
//what field to show/hide from - contact_type
var contactType = g_form.getValue('contact_type');
//hide value for non values
if (!isAdmin && (contactType == 'integration')){
g_form.removeOption('contact_type', 'integration');
}
}