How to disable the Add and delete button in Multi Row variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 11:36 AM
I have the requirement to show a list of users in a MRVS in a RITM. There will be only one column editable in the MRVS and rest of the columns will be read only. We do not want any one to be able to add any extra rows or delete the rows from the MRVS once the request is created.
Can anyone please help me how to achieve this?
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 12:02 PM
Hello -
This article was helpful to me in doing this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2021 12:03 PM
Would this be on the RITM record in the Platform UI?
Something like this has worked for me in the past: I commented out the line that hides the edit pencil.
function onLoad() {
var mrvsid = 'f0ce3f2b07b1a010c5cff1e08c1ed045'; //sys_id of the MRVS
document.getElementById('table_variable_buttons_' + mrvsid).style.display = 'none';
var mrvs = g_form.getValue('mvrs'); // name of the MRVS
var obj = JSON.parse(mrvs);
for (var i = 0; i < obj.length; i++) {
document.getElementsByClassName('btn-sm icon-cross multi-row-delete-row')[i].style.display = 'none';
//hide edit icon on each row of MRVS
//document.getElementsByClassName('btn icon-edit btn-sm')[i].style.display = 'none';
}
}
I hope this helps!
If this was helpful or correct, please be kind and remember to click appropriately!
Michael Jones - Proud member of the CloudPires team!
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2022 01:01 PM
For newer versions:
// Dom manipulation
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').hide();
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();
}, 250);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2024 02:11 PM
I need to do the opposite: how can I enable editing of the Multi-Row Variable Set (MRVS) on the Requested Item (RITM) after submission? I’ve tried client script or Ui policy , but it still doesn’t work....any idea??