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.

Make records read-only in Service Portal- Copy of Data Table widget

Uttam Sai
Tera Expert

Hi Team,

 

I am using Copy of Data Table widget in Service Portal to display outage records. Here , if i click on any one of the records , it is opening the record and fields are editable. What changes do we need to make the fields "read-only".

 

Thank you 

 

 

1 ACCEPTED SOLUTION

SanjivMeher
Mega Patron
Mega Patron

You can create an onLoad client script with below script and UI type as Service Portal

 

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

 


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

1 REPLY 1

SanjivMeher
Mega Patron
Mega Patron

You can create an onLoad client script with below script and UI type as Service Portal

 

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

 


Please mark this response as correct or helpful if it assisted you with your question.