Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How can we disable the pencil icon in Multi Row Variable Set for certain record?

Aarushi2
Mega Contributor

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

find_real_file.png

1 ACCEPTED SOLUTION

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.

 

View solution in original post

13 REPLIES 13

Sajilal
Mega Sage

HI Aarushi,

Check this article from Asif MRVS

Please Mark as ✅ Correct if this solves your issue and also mark ???? Helpful if it helps resolve your problem.

Thanks,
Saji

asifnoor
Kilo Patron

hi,

Check this article where i have provided steps on how you can disable the pencil icon.

Hi sir,

Your article is really very helpful but I want to disable the pencil icon for a certain record is that possible.

 

Hi Aarushi,

So are you saying you are having 2 rows in MRVS then you want to hide it only for 1 row?

please explain in detail

the script shared in my earlier comment should hide it directly

Regards
Ankur

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