logo

NJP

Make form non editable using Client Scripts for Change Requests

Import · Nov 18, 2022 · article

In this session, I have explained how to return multiple values from the script include and pass it to the client side.

If you have any feedback related to the scripting part, please write it in the comment box.

==================CLIENT SCRIPT====================

Table - Change Request

Type - OnLoad Scripts

function onLoad() {

//Type an appropriate comment here and begin the script below

var state = g_form.getValue('state');

if (state == 3); {

var fields = g_form.getEditableFields();

for (var x = 0; x < fields.length; x++) {

g_form.setReadOnly(fields[x], true);

}

}

}

View original source

https://www.servicenow.com/community/developer-articles/make-form-non-editable-using-client-scripts-for-change-requests/ta-p/2387123