Remove Pencil And cross icons from MRVS

Community Alums
Not applicable

Hi All,

We have a requirement to populate affected users asset details in MRVS. And we don't want to give them option to delete or edit asset details. I was able to hide Add and Remove all Buttons but unable to hide Pencil and Cross icons.

I already referred to Article but no luck.

Can some one help me on this. 

Sagar12_0-1667906167219.png

 

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

Here's a different version of that part of the script that is working for me in the native UI / Service Catalog on San Diego.  Ensure the Isolate script box remains unchecked after the script is updated.

 

var mrvs = g_form.getValue('mrvs1'); // internal name of the MRVS
var obj = JSON.parse(mrvs);
for (var i = 0; i < obj.length; i++) {
	document.getElementsByClassName('btn-sm multi-row-delete-row')[i].style.display = 'none';
	document.getElementsByClassName('btn icon-edit btn-sm')[i].style.display = 'none';
}

Some versions/environments have 'cross' in the ClassName instead of 'delete', so if this works for edit, but not delete then inspect the element with your browser developer tools to check the name.

 

Community Alums
Not applicable

Hi @Brad Bowman  

I have tried the above code on on-load catalog client script but no luck.

Sagar12_0-1667911262085.png

 

Be sure to wrap this in the timeout function that is at the beginning of your linked example since the MRVS takes a bit to load as the form is loading.