Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to make UI macro fields read only in the variable editor?

Sana10
Kilo Contributor

Hi Everyone

I was trying to make a variable of type UI Macro Read Only in the 'Variables Editor' of Requested Item Form but i couldn't find any solution.If any of you has tried the same and found a solution please let me know.

 Can any one suggest how to do this or share the experiences who used it and find the way to do it ?

 

Thanks and Regards.

2 REPLIES 2

Ct111
Tera Sage

Hi ,

 

CHeck the below link where the user faced same issue

https://community.servicenow.com/community?id=community_question&sys_id=d6e883a1db5cdbc01dcaf3231f96...

 

Mark my ANSWER as CORRECT n also HELPFUL if it helped

Ajay_Chavan
Kilo Sage

Hi There,

 

try 

For example:

 

 

HTML/XML:



<g:ui_reference name="my_ref" table="sys_user" />



 



Client Script:



var ro = gel('sys_display.my_ref');



ro.readOnly = true;

 

If this resolves your query, please mark my comments as correct  and helpful  .

Regards,

Ajay Chavan

My Community Articles

LinkedIn

 

Glad I could help! If this solved your issue, please mark it as Helpful and Accept as Solution so others can benefit too.*****Chavan A.P. | Technical Architect | Certified Professional*****