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.

How to set HTML variable read only in a catalog item in Istanbul version

sreejith12
Tera Expert

hello Team,

I have tried below steps to make the HTML variable read only in the catalog item but it doesn't work.

1) Create a catalog client script " On load" with below script:

function onLoad()

{

g_form.setReadOnly('variable_name',true);

}

2) Created a Catalog UI policy and made the variable read only.

3)Set "Create roles" and "Write roles" to "nobody" on the HTML variable.

None of these techniques work to make the HTML variable read only. Please let me know if there is any way out on this.

Thanks,

Sreejith

8 REPLIES 8

lasse3
Giga Guru

In your Catalog Client Script did you remember to set the UI Type to "All" or "Mobile"?



find_real_file.png



/Lasse


Hello Lasse , Karthik,



Yes, Please check the below screenshot of catalog client script :



find_real_file.png


Hi,



This script looks perfect !!



Can you recheck the variable value 'Preview' ? Check if you are using the Question(Display name) instead of Name(Value of the variable).



Thanks,


Santo


Yes, I am using the correct one Name and it doesn't matter as both the display name and value are the same.



Thanks ,


Sreejith