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

Hi Ajay,



DOM manipulation will not work if they use this catalog item in service portal or the chances are also high when they upgrade the instance.


K10
Kilo Guru

Hello,



You May use a Cataloge client script to make all of them read only. Make sure that you run the client script only on Requested ITEM/ Task


Mihir Mohanta
Kilo Sage

You have to write an on load client script on sc_req_item table.




function onLoad() {


    //Type appropriate comment here, and begin script below


    if(g_form.getValue('cat_item')=='sys_id_of_catalog_item' && g_form.getValue('assignment_group') !='sys_id_of_assignment_group'){


  g_form.setVariablesReadOnly(true);


}


}



Write down the appropriate sys_id in place of bold text


Manohararuna
Tera Contributor

Hello Bhaskar ,

 

      Here i have attached one example related to one incident form . please follow this 

Manohararuna_0-1728030185427.png

Thanks,

 D Manohar Reddy.