Hide Remove all and cross button from multirow variable set

1234567789hrebn
Tera Expert

Hi All,

 

i need to hide remove all and cross buttons from multirow variable set .

 

19 REPLIES 19

Harsh Vardhan
Giga Patron

do you want to hide those option from RITM variable editor ? if yes refer the below thread. 

https://community.servicenow.com/community?id=community_question&sys_id=9551f28cdb3abf40feb1a851ca96...

No at Catalog Item level

Nicholas H
Tera Expert

Hi, don't know if you still need this, just figured out a possible solution so I thought I would share for you/any others who are searching for this too. Using an on load catalog client script on catalog item that has the MRVS. Not ideal, but works well enough for our usage where we wanted users to only be able to edit pre-populated values in the MRVS variable...

function onLoad() {
//Type appropriate comment here, and begin script below
// hide remove button
setTimeout(function () {
	var x = this.document.getElementsByClassName("btn btn-default");
	//alert(x[4].getAttribute("ng-click"));
	var i;
	for (i = 0; i < x.length; i++) {
		if (x[i].getAttribute("ng-click") == 'c.clearValue()' && x[i].getAttribute("type") == 'button'){
		x[i].style.display = 'none';
		
		}
	} 
	
	
	
// hide all x buttons
	var y = this.document.getElementsByClassName("wrapper-xs fa fa-close");
	var j;
	for (j = 0; j < y.length; j++) {
		
		y[j].style.display = 'none';
			
	} 
	
	
//hide add button
	var z = this.document.getElementsByClassName("btn btn-primary m-r");
	//alert(z.length);
	var k;
	for (k = 0; k < z.length; k++) {
		if (z[k].getAttribute("title") == 'You can add only 5,000 rows'){
		z[k].style.display = 'none';
	
		}
	} 
	}, 1000);		
}

Hello,

 

I  used the same script as our requirement is same but the script is not working in my instance. Please let me know if you have made changes to fix the issue to hide 'X' icon on Mrvs.

 

 

Thanks,

Achu