- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 02:27 AM
my Requirement is to disable the pencil icon i.e Edit icon in a multi-row variable set for a certain record?
Any solution would be welcome.
Thanks in advance
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 04:47 AM
Hello Arushi,
Good to know that my articled helped you. If you want to hide for specific icon, there is no directly way.
In your rows , you can do a check for the text in the 1st column (after pencil) and if that matches you can hide it. Here is sample code for that.
icon = this.document.getElementsByClassName("wrapper-xs fa fa-pencil");
for (i = 0; i < icon.length; i++) {
if (icon[i].getAttribute("title") == 'Edit Row') {
if (icon[i].parentNode.nextElementSibling.innerText == 'YOUR TEXT') {
icon[i].style.display = 'None';
}
}
}
In the code, replace it with your text and then check. Then it will disable the pencil icon only for that row having that text.
Mark the comment as a correct answer and helpful once worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 05:43 AM
sir
can we apply it on any variable having a choice list for specific items?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 05:52 AM
Hi,
When it comes to the MRVS table on the catalog item view, they are plain strings. So yes you can apply on any variable.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2020 01:35 AM
If this has answered your question, kindly mark the comment as a correct answer and helpful so that the question is moved to the solved list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2020 02:59 AM
Hi Aarushi,
please use onload catalog client script
- Ensure Isolate Script field is set to false
- This field is not on form but from list you can make it to false
If you want to hide it on RITM then use Applies on Requested Item - True
If you want to hide it on SC Task then use Applies on Catalog Task - True
function onLoad() {
//Type appropriate comment here, and begin script below
var z = this.document.getElementsByClassName("btn icon-edit btn-sm");
z[0].style.display = 'none';
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader