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

I need to do this, too - and cannot get it to work.   Tried modifying the script from SNGuru to omit that one variable from the scratchpad.   It doesn't work.  


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.