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

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

 

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.

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);


}

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

CoyoteRay1
Tera Contributor

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.