Remove Pencil And cross icons from MRVS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 03:19 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 04:06 AM - edited 11-08-2022 04:09 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 04:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 05:09 AM
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.