We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Make all fields readonly when state s changed to closed including work notes

Priyanka_77
Tera Contributor

I want to make all the fields read only including work notes on hr case form when state is change to closed.

3 REPLIES 3

Mark Manders
Giga Patron

Put a deny-unless write ACL on the table with active = true as condition. Deny-Unless ACLs are evaluated first. If the case isn't active, nobody can write to any field on the table.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Ankur Bawiskar
Tera Patron

@Priyanka_77 

please use approach mentioned by @Mark Manders 

Do let us know if any further help required

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Tera Patron

Hi @Priyanka_77 

 

To make all fields—including work notes and additional comments—read-only on the HR Case form when the state changes to Closed, use a combination of an ACL and a UI Policy or try with only ACL

 

1. To ensure that users cannot bypass these UI scripts (such as via list editing or REST APIs), create a Write ACL
Navigate to System Security > Access Control (ACL) and click New.
• Type: record
• Operation: write
• Name: HR Case [sn_hr_core_case] and select None (for table-level) or * (wildcard) to lock all fields.
• Requires role: Select roles authorized to edit active cases
• Condition: Add State is not one of Closed Complete, Closed Incomplete, Closed Rejected, Canceled (adjust according to your HR configuration).

 

2. Create a UI Policy
Use a UI Policy to prevent edits upon form load
• Table: HR Case (sn_hr_core_case)
• Conditions: State is Closed //update condition as per your requirement
• UI Policy Actions:
o Select Leave unchecked for Reverse if false.
o Add the Work notes and Comments (Additional Comments) fields with other field as per your requirement and set their Read-only status to True.

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti