Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Client script for blocking edits in list view

catchdini
Tera Expert

I have a requirement to use a client script, which should not allow editing in the list view for the incidents that are closed. Basically, if the incident is closed, then no matter which field I try to change in the list view, I shouldn't edit. How do I achieve this?

1 ACCEPTED SOLUTION

Hi Brad, I have used the below condition (in pic) to block editing in list view for closed incidents. I have some questions in this, can you plz clarify? Though the questions might look easy, but it will help me clarify/understand ACL's better.


- The specified condition is "Incident State is not Closed", though the condition that I wanted is "Incident State is Closed". Why I have to give condition in the reverse way?


- I have added the admin in 'Sys User Role' (its not in the below pic). I added admin role thinking that admin will be able to edit the closed incidents in list view but admin is also not able to edit. I didnt understand why.



ACL-Incident.jpg


View solution in original post

8 REPLIES 8

brad_hicks
Giga Expert

Your best bet here is to use a contextual security rule on the incident table for list edits with the condition of incident is closed.   A great example of this is located here - Administering the List Editor - ServiceNow Wiki.


Hi Brad, I have used the below condition (in pic) to block editing in list view for closed incidents. I have some questions in this, can you plz clarify? Though the questions might look easy, but it will help me clarify/understand ACL's better.


- The specified condition is "Incident State is not Closed", though the condition that I wanted is "Incident State is Closed". Why I have to give condition in the reverse way?


- I have added the admin in 'Sys User Role' (its not in the below pic). I added admin role thinking that admin will be able to edit the closed incidents in list view but admin is also not able to edit. I didnt understand why.



ACL-Incident.jpg


Also, there is a way to completely block list editing by unchecking 'Enable List Editing' in Sys Properties - UI Properties


zheil
Mega Expert

You will have to use an Access Control rule like the one below. You can of course add your script conditions to the rule.


22-07-2014 19-17-15.jpg