How to set all variables read only on RITM

Bhaskar24
Tera Expert

Hi All,

I want to set all the variables (ex: IT Onboarding Ticket etc..) read-only only on the RITM (not on Catalog Item) if the item: "Employee Requirements" and Assignment group is not "NAR CIB Onboarding" (please see below snippet)

find_real_file.png

Could you please help me!

Thanks & Regards,

Bhaskar

1 ACCEPTED SOLUTION

Hi Bhaskar,



If you want to restrict this behavior only for one item,you can write the above script on Employee Requirements item in Catalog client script instead of Requested Items Table and you can set a condition as



function onLoad() {



if(assignment_group!='NAR CIB Onboarding')


{


  g_form.setVariablesReadOnly(true);


}


}


View solution in original post

13 REPLIES 13

lakshmidurga
Tera Expert

Hi Bhaskar,



Please use on Load Client script on sc_req_item tables as



function onLoad() {  


 


  g_form.setVariablesReadOnly(true);  




}  



I have used this and it is working fine for me.



Thanks&Regards


Lakshmi Vallisetty


Hi Lakshmi,



I want to set read-only the variables if item: "Employee Requirements" and Assignment group is not "NAR CIB Onboarding" only.


Could you please help!



Thanks & Regards,


Bhaskar


Hi Bhaskar,



If you want to restrict this behavior only for one item,you can write the above script on Employee Requirements item in Catalog client script instead of Requested Items Table and you can set a condition as



function onLoad() {



if(assignment_group!='NAR CIB Onboarding')


{


  g_form.setVariablesReadOnly(true);


}


}


Please note that g_form.setVariablesReadOnly() method is undocumented and therefore not officially supported method. It is best practice to make field/variable read only using Catalog UI Policy.