How to Make Formatter Variable section read-only in Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 09:33 PM
I am using Formatter in form design to show all fields from record producer. When i tried to make every fields in read-only, the fields under variables section which is displaying those from record producer, all except reference fields are becoming read-only. How to make reference fields in variables sections also read-only?
currently i am using the below code :
var fields = g_form.getEditableFields();
for (var x = 0; x < fields.length; x++) {
g_form.setReadOnly(fields[x], true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 09:50 PM
Can you check if there are any other client scripts applied on RITM that are making those variables editable.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 09:57 PM
I just tested and looks like it's bringing all the editable fields on ritm record with variable names as ni.<<variablesysid>>, keep below log and check the variable names.
var fields = g_form.getEditableFields();
g_form.addInfoMessage(fields);
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP