Edit catalog Item varibales in Catalog task form

Black Coder
Tera Guru

We have created a catalog request. We have to make once catalog item variable as editable in catalog task form. Right now it is available as read only in catalog task form. How to configure this

Variable.PNG

We have tried following script but it doest work

 

client.PNG

 

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Hello write client script on catalog task table with below line

g_form.setReadOnly('variables.model',true); // it should be variables.variablename
Regards
Harish

Harsimranjeet 1
Tera Expert

Hi @Black Coder 

 

Please rewrite as:

g_form.setReadOnly('variables.model',false); //will make model variable as editable.

 

Simran

Sagar Pagar
Tera Patron

Hi @Black Coder,

 

I believe you do have Catalog UI policy which makes it read-only. after the execution of onload Catalog client scripts.

 

How you are making all variable s read-only on RITM and Catalog tasks? you can add condition there itself and make it editable to if uses has the itil role/

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

Ashwini Jadhao
Giga Guru

Hi @Black Coder ,

May be you have onLoad() client script for RITM to make all variables read only. Which contains below code:

g_form.setVariablesReadOnly(true);
If it is present then Inactivate that client script and create new onLoad() client script and make variables editable  and read only as per requirement or create UI policy with highest order to make variables editable on RITM/TASK.