How to disable remove and add button on MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:16 AM
Hello Everyone
I need to disable multirow variable set buttons(add and remove all) edit button should be visible on RITM. I tried this by using client scrip in my pdf which applies on RITM but it is working for catalog item view not on RITM.
Please suggest on this.
function onLoad() {
//Type appropriate comment here, and begin script below
setTimeout(function() {
disableButtons();
}, 2000);
}
//var n = new GlideRecord('sc_req_item');
//n.query();
//while (n.next()) {
function disableButtons() {
var mrvsid = '41226d96c32222104b501533e4013121';
this.document.getElementById(mrvsid + '_add_row').style.display = 'none';
var mrvs = g_form.getField("mrvs1"); //internal name of MRVS
mrvs.max_rows_size = 0;
var btn = this.document.getElementsByClassName("btn btn-default");
for (i = 0; i < btn.length; i++) {
if (btn[i].innerText == 'Remove All') {
btn[i].style.display = 'None';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:21 AM
where you want to disable? RITM form?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:28 AM
@Vinod S Patil Have you enabled below checkbox on Catalog Client Script?
✔️ If this solves your issue, please mark it as Correct.
✔️ If you found it helpful, please mark it as Helpful.
—
Shubham Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 06:45 AM
yes shubham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2025 05:34 AM - edited 07-07-2025 05:34 AM
Hi @Vinod S Patil ,
I have hidden clear and delete button on my MRVS using below code , it works everywhere on catalog item view , ritm view and on portal :
I have written this code in my onload client script