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.

SimonMorris
ServiceNow Employee
ServiceNow Employee

Xavier asked on the Community forums "Can I make every field on a form read-only?"

You can! Use a g_form method to enumerate the editable fields on a form, and then iterate through them, setting them as read-only.



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

10 Comments