Restrict available options to a dropdown field in a list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2016 04:37 AM
In a list view for task records, i.e Open Incidents, the State field is one of the valid columns.
In various forms using the State field we are using Client Scripts to hide options like Resolve and Close. We do not set those option to inactive in the sys_choice table, because if we do then we can't select them in Report filters etc.
We are also using UI Policies and ACL's to restrict or allow various actions to the State field.
However, when it comes to list views, the State field is wide open. Meaning that the users can by double clicking it actually Resolve or Close the Incident.
And in our Processes we do not want to allow that from lists.
So today we have a list_edit ACL that restricts any update to the State field.
What we want to achieve is to allow some of the options to be available for the user, and options like Resolve and Close to be hidden. But so far we have not found any method for this in list views.
Anyone that can help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-11-2016 08:37 PM
Hi Tor
Even I thought that is not working and used list_edit ACL to restrict the entire field. But in list view the option is just visible if you try updating to the choice it will revert to the oldValue.
I tried it in Istanbul, I restricted it to "admin" role. So if I try with non admin user I am able to see the choice, but when I select the choice and click on that green button , the value is not changing.
If you want the choice to be invisible then yes list_edit ACL is the only available known option
Thanks
Sasi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-27-2021 01:25 PM
Hi Sasi,
I have a requirement to restrict the problem closure state choice based on role (problem manager) and group(with a prefix "xyz").
I was able to achieve this requirement partially i.e. for the role the restriction has been updated and works fine using below code. How do i add another condition to it for the second part i.e. group with prefix?
Any help would be really appreciated.
var isPrbMan = g_user.hasRole('Problem Manager');
if (!isPrbMan)
g_form.removeOption('state','6');
else if (isPrbMan) {
return;
}
Regards,
Surabhi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2016 05:26 AM
Hi Tor,
If you don't want that particular field not to be editable for the particular state by some user, create an write ACL and include the condition state is not resolved or closed in the ACL.
http://wiki.servicenow.com/index.php?title=Using_Access_Control_Rules