how to hide choice list field value in list view?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2016 05:16 PM
Hi,
I have a issue, in incident i have field call state, in that i have values like open, in progress, resolved and closed. so, for itil users i want to hide closed option in both list and form view?
- 6,741 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2016 05:28 PM
For the list view, in terms of selection, it is all or nothing.
- Prevent users from editing the state field via a list_edit ACL
- Disable list editing for the list
- Create a business rule to prevent users from setting ticket to closed, do via UI action
For the form:
- g_form.removeOption
GlideForm (g form) - ServiceNow Wiki
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2016 05:28 PM
The form part is easy. onLoad Client Script that says
if(g_user.hasRole('itil')){
g_form.removeOption('state', 6); // or whatever your closed value is
}
The easiest way to do it in a list is to put a business rule that says
Condition: gs.hasRoleExactly('itil') && current.state.changesTo(6)
current.setAbortAction(true);
gs.addErrorMessage('itil users cannot close tickets.');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2016 05:31 PM
You can also check out List Client Scripts: sys_ui_list_script_client
They have been deprecated, it seems, but you can still use them.
There are also list business rules: sys_ui_list_script_server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2016 03:43 AM
Is there any documentation or additional info on these scripts availabgle somewhere?