Read Only Service Catalog Variables Except for One

abrahams
Kilo Sage

I found a very nice script (http://www.servicenowguru.com/scripting/business-rules-scripting/variables-form-readonly/) to lock down variables on a Service Catalog task however there is one variable that I don't want locked down. I've tried a number of ways to skip over this one variable or make it setReadOnly to be false once the script set the element to read only. All my attempts have failed. I am fairly new at writing JavaScript so I probably don't completely understand accessing elements yet. I've tried g_form.setReadOnly('variables.UserID',false); and g_form.getElement('variables.UserID').readOnly = false; amoung other things. None appear to work. Would someone know how I can make this one variable editable? The name of my ServiceCatalog variable is UserID. It is not ServiceNow's UserID.

1 ACCEPTED SOLUTION

We are on Eureka now.   Catalog UI Policies allow you to indicate if a variable should be read only, Mandatory and/or Visible.   It also allows you to choose if you want it to apply to a Catalog Item, Task and/or Requested Item.   I hope that helps.


View solution in original post

6 REPLIES 6

MVRakesh
Mega Contributor

You Can try it using the catalog ui policies actions


abrahams
Kilo Sage

It would be nice if that would work however this is on the Service Catalog Task record. I don't see an option for that in UI Policy.


abrahams
Kilo Sage

I will give this a try in the system UI policy. I don't see how it would work in the catalog ui policy. The user that needs to enter this field is not the same user that is filling out the item.


abrahams
Kilo Sage

I tried a system UI policy for sc_task however I don't seem to have variables available in that policy.