How to make fields on "Request Item" form read only if a particular request item was chosen?

santrym
Mega Expert

I have a request item that, upon submitting a request for it, I would like its resulting "Request Item" form to have all it's fields made uneditable/read-only. Is there a way to do this without accidentally making all "Request Item" forms uneditable?

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Michael,



You can do this with a UI policy. Use the condition field on the Catalog item field and add the fields to make read-only in the related list (after you save.)



Creating a UI Policy - ServiceNow Wiki


View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

Hi Michael,



You can do this with a UI policy. Use the condition field on the Catalog item field and add the fields to make read-only in the related list (after you save.)



Creating a UI Policy - ServiceNow Wiki


I wasn't able to figure out how to write an ACL on sc_req_item, so I used this method and it seems to be working great. Is this bad? Why exactly is Abhinay E's method more secure?


UI policies work on the client side. Because of this, anyone with a moderate amount of browser knowledge can change the behavior. Making a field read-only or mandatory can fairly easily be overridden.



ACLs, on the other hand are enforced at the server side and cannot be hacked.



Another option is to create a Data policy (the server side brother of a UI policy) to enforce the conditions on both ends. Data policies and UI policies can be made to work together quite easily.



Data Policy - ServiceNow Wiki


Abhinay Erra
Giga Sage

Create a Write ACL on sc_req_item table and select the conditions, Item is not <the item you want the fields to be not editable>