Set Entire form to Read-Only?

airwin77
Kilo Contributor

Does anybody know of a useful script that could be added to either a client script, or a UI action that would set all fields to read only. I have all my closed task going to a closed state, and active set to false, however the ServiceNow suggested method of ussing a UI policy with UI actions for each field is a real pain when your working with 80 to 100 fields. I'm trying to see if there is script that will support some sort of everything wildcard (*.* ), so it makes the entire form read only. The current UI method I use is not very dynamic, so it requires maintenance as you make form changes. Likewise it doesn't matter if it goes Readonly or Disabled, as long as changes can't be applied.

5 REPLIES 5

jeff_tam
ServiceNow Employee
ServiceNow Employee

You may want to consider using an ACL so that the "Write" operation for the table's fields (i.e. incident.*) is allowed if the Task is NOT in a Closed state? If the task is Closed, then the "Write" operation is not allowed preventing users from making changes and only being able to read.

Hope this helps.

Jeff


Because are closed task are reviewed by another group, not directly part of my company all closed task must be read only. Essentially in a locked status so that no one can make any changes and that might go as far as to even prevent changes from a ServiceNow admin. So the fields must be disabled or set to read only but either way it must not be able to be changed.


jeff_tam
ServiceNow Employee
ServiceNow Employee

As mentioned, you could accomplish this desired effect by editing an existing / creating a "Write" ACL on the table so that the fields can only be edited if the State != Closed (or a similar condition). If the State is "Closed", then all of the fields on the task would be read-only assuming you also have the proper "Read" ACL in place.

Let me know if you need any additional details on how to get this done.


Thanks-
Jeff


I'm attempting the ACL route, which I know is the only way to actually place secrurity on this content. However I'm not having the greatest luck getting this ACL to work the way described. I've set the condition, however where i'm unsure is if I need to alter any of my existing ACL's first, and then should I apply this condition to a specific role or leave the roles blank?

I might have to clean up some old ACL's mainly because my instance went thru that whole Aspen issue where ACL were read correctly for a few patch versions. I am currently on Berlin Patch 2, and working on deploying patch 5 hotfix 1.