Hide Remove all and cross button from multirow variable set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2019 03:31 AM
Hi All,
i need to hide remove all and cross buttons from multirow variable set .
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 10:43 PM
Hi,
Its still working for us in the latest version of new york. Have you set the catalog client script ui type to "all"?
Kind Regards
Nicholas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2020 12:25 AM
Hi Achu,
Did you get any resolution for this? I also have same requirement and I am facing same issue. I used above script but 'x' icon is still visible on MRVS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2020 02:42 PM
The below script worked for me. Please check
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
setTimeout(function () {
var Xclass = document.getElementsByClassName('btn btn-sm icon-cross multi-row-delete-row');
var i;
for (i = 0; i < Xclass.length; i++) {
Xclass[i].style.visibility ="hidden";
}
}, 1000);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2020 08:47 AM
I have a similar situation, where I am pre-populating my MRVS using the code found here: https://community.servicenow.com/community?id=community_question&sys_id=c9570089dbb1ef00fa192183ca96...
I need to have exactly these number of records, so I want to remove all Add and Remove capabilities, only leaving the "Edit" option.
I tried applying your code posted here, and it did everything except remove the "Add" button. I see in your code you have the statement "You can only add 5,000 rows". Is there something in that code that only removes the "Add" button when they get to 5,000 rows? I do not see the number 5,000 listed anywhere in the code.
How can I make this code remove the "Add" button on Load?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 08:35 PM
Got this to work for me. Following the instructions above with the following code changes:
function onLoad() {
//Type appropriate comment here, and begin script below
setTimeout(function () {
//hide the add/remove table
var z = this.document.getElementsByClassName("sc-table-variable-buttons");
// alert(z.length);
var k;
for (k = 0; k < z.length; k++) {
z[k].style.display = 'none';
}
}, 1000);
}
The above hide the add / remove table. The remove record "X" was still present, use the following else where to hide that.
var y = this.document.getElementsByClassName("btn btn-sm icon-cross multi-row-delete-row");
// alert(y.length);
var j;
for (j = 0; j < y.length; j++) {
y[j].style.display = 'none';
}
Hope the above helps.
I'm on the lastest New York release.