Incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 09:52 PM
When the user select Incident state is "On hold" then remaining all fields should be Read only.
Any idea how to build this above example task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 10:18 PM
Check this
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 10:23 PM
you can use onChange client script on State field like this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == oldValue) {
return;
}
if (newValue.toString() == '3') {
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2025 10:25 PM
Hi,
Do you really want to set _all_ other fields as read only?
In my mind, that would be a bad experience for the user.
Then you would not allow the fulfiller to write a comment or worknote if the record is in onhold.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2025 12:51 AM
Hello,
I'd suggest the low-code way of using an UI Policy in System UI application (unless there are other factors in play that would make say scripts more efficient as an solution).
Crate a new record in UI Policy.
Set Table as Incident [incident].
Use condition:
State I is I On Hold
After that simply use create new UI Policy Actions in the bottom of the form, and select as many fields to be set as read-only as you need. As others have mentioned, it might be good to consider what fields are needed to be read-only, and what should be left as it is.
Hope this helps! I took a screenshot below of an example as well, in case a picture is useful as well.