Make Variables editable on RITM form

mayank93
Kilo Contributor

I am using g_form.setVariablesReadOnly(true) to make the variables Read-Only. But I have a requirement to make the variables editable on RITM form at a certain stage.

Using a client script to set those variables editable doesn't seem to work. How do I achieve this? I am using the Jakarta version.

1 ACCEPTED SOLUTION

divya mishra
Tera Guru

Hey Mayank,



Creating UI Policy based on condition would be fruitful.



Please Hit ✅Correct, ��Helpful, or ��Like depending on the impact of the response


Have a lovely day ahead


View solution in original post

6 REPLIES 6

Kalaiarasan Pus
Giga Sage

You can either use a client script, UI policy, Catalog UI policy or a catalog client script to do. Choose whatever fits your need.


Harsh Vardhan
Giga Patron

if you have written any catalog client script or catalog ui policy to make the variable read only and you don't want that should be read only at RITM level then in catalog client script or catalog ui policy has option "applies on request items" unchecked it then that will not apply to RITM level.



demo.png


Harsh Vardhan
Giga Patron

if you want to make it editable that variable then you should pass it "false" parameter.


share your script?



  1. g_form.setVariablesReadOnly(false); //"true": make it read only

This is a global script I'm using to make variables readonly on RITM (exception being SD users):



function onLoad() {


    //Type appropriate comment here, and begin script below


if((!g_user.hasRole('service_desk'))){


g_form.setVariablesReadOnly(true);


}




}



Now I need to make variables on some items as editable(at a certain stage) to itil users as well. I have tried the UI policy on that variable as Read-Only false on RITM. It doesn't work.