The CreatorCon Call for Content is officially open! Get started here.

How to Make Formatter Variable section read-only in Form

Goutham Varma
Tera Contributor

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);

}

Variable Formatter.jpg

2 REPLIES 2

Voona Rohila
Mega Patron
Mega Patron

Hi @Goutham Varma 

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

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