How to make a field readonly in one catalog item which is part of mrvs

Anirudh_saraf
Tera Contributor

Hi Community,

 

The requirement is to make a variable read only in one catalog item.

 

For example there is a field called as hardware which is part of  a variable set. This variable set is part of catalog A and Catalog B. We should make this field editable in catalog A and it should be in readonly in Catalog B.

 

Please let me know if anyone have implemented this earlier

 

Thanks 

10 REPLIES 10

Sandeep Rajput
Tera Patron
Tera Patron

@Anirudh_saraf You can choose to create a UI Policy or client script on Catalog Item B and make the hardware field read only via the UI Policy Action or client script on Catalog Item B.

 

Please mark the response helpful and correct if it manages to address your question.

Thanks for your reply 

I have tried below  catalog client script but it is not working 

var hardwareVar = g_form.getControl('hardware_name');
   if(hardwareVar){
    hardwareVar.disabled = true;
   }
   

@Anirudh_saraf Unfortunately, you will not be able to access the hardware_name field in catalog client script if it is part of MRVS.

Is there any other way to achieve this as its not working with UI policy as well. When I am trying to create the UI policy action the entire variable set is being selected and I am unable to dot walk and select the particular field