Multi Row Variable Set - Disable 'Remove All' and 'Delete' functionality (Catalog form)

Robbie
Kilo Patron
Kilo Patron

Hi,

Has anyone managed disable any of the properties and functionality associated with the new Multi Row Variable Set on the Service Catalog form? 

Specifically, I'm trying to disable the 'Remove All' option as well as the delete functionality (x icon per row). Whilst I can achieve this via DOM manipulation, obviously I'm very conscious of the unsupported nature around this.

I've tried setting UI policies for example as well as setting write roles etc, however I'm not having much success using supported approaches. Anyone else tried this?

To provide some background as to the why, we're leveraging the MRVS to present a list of Assets and asset data associated against a user and asking a user to confirm, edit and add data if required. However for anything pre-populated we want to prevent deleting or removing this data. Any data the user choses to add, this could be removed/deleted.

Thanks in advance,

Robbie

16 REPLIES 16

dsnoeij
Tera Contributor

Hey Robbie,

I did find out how to make it compleetly read-only. You can do this in the catalog item that holds the link to the var_set or if you want a more generic way, create a second var-set and set that one to single row. Just add an onload catalog client script with below script.

var field = g_form.getField("ID-OF-YOUR-MULTILINE-VAR-SET");
field.readonly = true

 

Hope this works for you!

 

Gr,

Community Alums
Not applicable

This worked brilliantly for me, thank you:)

You can make the complete variable set ready only, by the following

g_form.setReadOnly("multirow_var_set_name',true); 

This will make your multivar set read only and hides the edit and delete icons as well.

D N
Tera Contributor

Hi this doesnt work for me. Can you explain more where to use it and maybe include screenshots? I tried the catalog client script on the main catalog item and also tried the client script within the Multi Row Variable set and its not working.

The read-only UI policy doesnt meet my needs so I need a way of making the entire variable set read-only in Catalog Item view.

 

Thanks

Community Alums
Not applicable

Did you use the onload client script? And yes, a UI policy will not work.