- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 02:46 PM
In the Incident table's listview, I would like to prevent users from changing to "Resolved" state. See below for screenshot:
This should only happen if "Field_X" on the Incident table is true. Otherwise, permission is granted to select any of the state fields from the listview, including "Resolved".
If "Field_X" is true, every value in this field should be able to be changed except for "Resolved".
I'm unable to figure out a way to do this. Every time I try to set an ACL, it blocks the entire field (cannot choose/change any values). Is this possible to do with an ACL or a script (business rule, script include, etc)?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 03:09 PM
You can Use current.setAbortAction(true) to abort transaction in business rule.
https://docs.servicenow.com/bundle/newyork-application-development/page/script/business-rules/concept/c_AbortingADbActionInABusinessRule.html
var ciname=current.name;
var gr=new GlideRecord('cmdb_ci');
gr.addQuery('name',ciname);
gr.query();
while(gr.next())
{
gs.addErrorMessage('Record already present');
current.setAbortAction(true);
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 02:58 PM
You can configure business on change of state values and provide user friendly message to user.
This way it will work on both form and list views.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 03:02 PM
Hi thank you for the response!
How does that stop the user from making a change? Can you provide an example? I understand a message is nice but I'm hoping for something that prevents.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 03:09 PM
You can Use current.setAbortAction(true) to abort transaction in business rule.
https://docs.servicenow.com/bundle/newyork-application-development/page/script/business-rules/concept/c_AbortingADbActionInABusinessRule.html
var ciname=current.name;
var gr=new GlideRecord('cmdb_ci');
gr.addQuery('name',ciname);
gr.query();
while(gr.next())
{
gs.addErrorMessage('Record already present');
current.setAbortAction(true);
}
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 03:14 PM
Hi,
If you want to make the field read-only only in the list-view then you need to configure the ACL of type list-edit. See the below screenshot for reference. Admin override must be false if you even don't want admins to change that.
Hope that helps!
Thanks,
Muhammad
Muhammad