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.

All incident form fields make read only with script

SrinivasS779136
Giga Contributor

All incident form fields make read only with script

3 REPLIES 3

AndersBGS
Tera Patron
Tera Patron

Hi @SrinivasS779136 

 

Please state a more clear business requirement - it's not clear based on your  input.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards 

Anders 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

stefan_kreil
Tera Contributor

Solved: When incident is closed, what makes all the fields... - ServiceNow Community

There is an ACL that currently prevents ITIL users from editing closed incidents. Within this ACL, there is a condition that only allows editing if the incident state is not "closed" or "canceled." By removing this condition, ITIL users will be able to edit incidents even when they are closed.

 

ACL: https://your-instance.service-now.com/sys_security_acl.do?sys_id=66ec26370a0a0b0100a67b597d415b84&sysparm_view=&sysparm_domain=null&sysparm_domain_scope=null&sysparm_record_row=1&sysparm_record_rows=2&sysparm_record_list=operation%3dwrite%5ename%3dincident%5eORDERBYname

 

If this solution helps, please consider marking the answer as correct.

 

Sid_Takali
Kilo Patron

Hi @SrinivasS779136 Not sure what is your requirement. Below code will make all your form fields Read only. 

You can create a Ui Policy to see if it makes all fields read only based on condition , otherwise you can write a Client script.

 var fields = g_form.getEditableFields();
         for (var x = 0; x < fields.length; x++) {
           g_form.setReadOnly(fields[x], true);
}