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 Variables read only on RITM and Task

Mark Wood
Tera Contributor

Hello experts,

 I want to make all variables on the RITM and Catalog task read except one variable,

to make variables read-only I have onload client script :

g_form.setVariablesReadOnly(true);

above code making all variables read-only, I want all variables to be read-only except.

How can I achieve this please guide me on this.

thank you.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Mark Wood 

then handle those explicitly i.e. make them editable after that line

g_form.setVariablesReadOnly(true);

g_form.setReadOnly('variable1', false);

g_form.setReadOnly('variable2', false);

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Thank you for marking my response as helpful, if you feel links I shared are helpful please mark my response as accepted as well.

Please hit like and mark my response as correct if that helps
Regards,
Musab