Hiding MRVS Buttons on a Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 07:54 AM
i have a requirement to hide the REMOVE all button .. they are scared someone might delete all.. even though you have to say yes and it has be approved to do so...
so im asking you .. is there a way script wise to just hide the remove all button...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 08:02 AM
Hi,
Please refer below post.
How to hide buttons in Multi-Row Variable Sets (MR... - ServiceNow Community
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 08:12 AM
Hello @Walter Toney ,
We had same requirement previously.
To disable button on catalog task level. hope this will help you.
We have written onLaod Client script which run's on Catalog Task Level
var htmlDoc = false;
if (top.document.getElementById('gsft_main'))
htmlDoc = top.document.getElementById('gsft_main').contentWindow.document;
if (!htmlDoc) {
if (document) { htmlDoc = document; }
else if (top) { htmlDoc = top.document; }
}
// Add and Remove All
if (htmlDoc) {
htmlDoc.querySelector('.sc-table-variable-buttons').style.visibility= 'hidden';
setTimeout(function() {
// delete button
htmlDoc.querySelectorAll('.multi-row-delete-row').forEach(function(el) { el.hide(); });
//edit button
//htmlDoc.querySelectorAll('.sc-multi-row-actions > .icon-edit').forEach(function(el) { el.hide(); });
// //both buttons (and also the column)
// htmlDoc.querySelectorAll('.sc-multi-row-actions').forEach(function(el) { el.hide(); });
// htmlDoc.querySelector('.sc-table-variable-header:first-child').hide();
},2000);
}
}
Output :
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates