My code works in native UI but not on SP

Roshin Chandra
Tera Contributor

I have created a code For removing( Add/Remove) and Edit icon fron Multi-Row Variable Set .

It's working in native Ui but not on SP. 

I'm attaching the code and screenshots below for reference.

 

 

 

setTimeout(function() {


//hide the add/remove table
var z = this.document.getElementsByClassName("btn btn-sm icon-edit");
var k;
for (k = 0; k < z.length; k++) {
z[k].style.display = 'none';
}
}, 1500);
var y = this.document.getElementsByClassName("sc-table-variable-buttons");
var j;
for (j = 0; j < y.length; j++) {
y[j].style.display = 'none';
}


}

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Roshin Chandra 

if you remove add/remove then how user will update MRVS?
Why not make the MRVS readonly then it will hide the icons as well?

Check this link and response from mattcox

Disable buttons in MultiRow Variable Set 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

This MRVS is autopopulated from a custom table.

the req is user shoul be only able to select or remove data .not edit or add.

@Roshin Chandra 

then check the link I mentioned.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have gone throught it but it's not wrking.

My script is working in nativa ui But not inSP.