We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Make Variables read only on RITM and Task

abhijeetpaw
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

@abhijeetpaw 

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  ||  10x 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