Need client script for readonly

chgopikrish
Tera Contributor

Hi 

1. Restrict changes after request is closed in NCB API(S) table

In classic view allow submitter to add or edit APIs in the list after submission. But not after state=closed complete, or closed skipped or closed incomplete. Submitter should not be able to change any other field

1 REPLY 1

lpruit2
Kilo Sage

Greetings @chgopikrish. I would recommend looking into creating a new "write" wildcard ACL with a Data Condition on your custom table. If you have admin rights or security_admin rights in your ServiceNow environment, you can go to All > System Security > Access Control (ACL)

 

lpruit2_0-1765135377238.png

 

To see a similar example, you can check out the existing "incident.*" write ACL. I'll include screenshots below and summarize what is going on. 

 

Table: incident

Type: record - applies to the entire record

Operation: write 

Name: incident.* - This indicates it is a wildcard type ACL and applies to all fields on the form

 

lpruit2_1-1765135546043.png

 

Requires Role: You can choose an existing Role you would like to be included as part of the requirement to grant the ability to edit records. In the example "incident.*", the sn_incident_write Role is necessary but this is entirely up to you. If you do decide to choose a Role, to evaluate to true you would have to have BOTH the assigned Role AND match the Data Condition. 

 

Data Condition: This is where you will apply the State filtering you wish to achieve. In this example, the Condition Builder states "Incident State is NOT Closed (7) or Canceled (8 )". In your use-case, you would do something similar with "State is NOT Closed Incomplete, Closed Cancelled, or Closed Skipped."

 

lpruit2_3-1765135809313.png

 

Finally, I'll include some useful ServiceNow documentation about creating new ACL records. I hope this information is helpful! 

Create an ACL