I want to hide the Update Button

Sanjay Bagri1
Tera Guru

I have tried this script in onload client script but controller is not entering in this script :

this script is not working.

 var items = $$('BUTTON').each(function(item){

 alert("Step -1");
        if(item.innerHTML.indexOf('Update') > -1){
                alert("step -2");
                item.hide();
            }
        });

find_real_file.png

How to solve please any one can tell me .

Thanks

Sanjay Bagri

1 ACCEPTED SOLUTION

Sanjay Bagri1
Tera Guru

Yes i got it solutions for hide the button for specific table

  in ui action conditions i have written below condition only

     current.getTableName == ('table name')

View solution in original post

12 REPLIES 12

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,


So you don't want this Update button on this table right?

 

If yes follow below steps:

1) Go to UI Action's

2) Open Update button which is on Global Table

3) Change table to your table on which you have to hide this button and then click insert and stay.

4) Then deactivate this new button. So you won't be able to see Update button any more.

 

Note: This is just to hide button on table and not based on conditions.


Thanks,
Ashutosh

Hi Ashutosh,

your approach is not working .is there any other way by script.

Can you tell me please.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sanjay,

So you don't want users to update the record so better approach would be have a write ACL and give roles for whom records can be edited.

Because you don't want users to update the record better to make fields readonly as well

if acl evaluates to true update button would be shown if acl evaluates to false then update button would be hidden

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Sanjay Bagri1
Tera Guru

Yes i got it solutions for hide the button for specific table

  in ui action conditions i have written below condition only

     current.getTableName == ('table name')

Hi @Sanjay Bagri1 

Where exactly you have written this condition and how it works in hiding the button "update" button for specific table