How to remove Delete UI action in forms and lists

Madhan007
Tera Contributor

Hi,

I have created a table in a scoped Application.How can I hide the "Delete"UI action in both form and list with out modifying Access controls?

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @Madhan007,

 

So my response is not lost in the thread, I'm reposting here.

Having reviewed your question, as @Anurag Tripathi has outlined, best practice here is to control this via ACLs.

 

Essentially you'll need to create 2 ACL's - one for 'delete' access, and the other for 'list edit' access.

Once you've specified exactly which role can delete (eg admin, however, I would encourage you to think about other users so admins/devs become an achilles heel to the process), all users that don't have the role will not be able to delete or see the UI Action.

 

Below, I've provided an ACL on the Problem table where only users who have the 'itil_admin' or 'problem_admin' role can delete a record. If a user views a Problem without this role, they will not see the 'Delete' button (The UI Action)

Reminder, you'll need to create an ACL for both the 'delete' and 'list_edit' actions.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Robbie_0-1707227422779.png

 

 

View solution in original post

9 REPLIES 9

Mark Manders
Mega Patron

Why do you want to hide them, without doing something with who can and can't use something? 
But maybe this will help: https://www.servicenow.com/community/developer-forum/how-to-disable-or-hide-the-delete-button-in-for...



Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Robbie
Kilo Patron
Kilo Patron

Hi @Madhan007,

 

Having reviewed your question, as @Anurag Tripathi has outlined, best practice here is to control this via ACLs.

 

Essentially you'll need to create 2 ACL's - one for 'delete' access, and the other for 'list edit' access.

Once you've specified exactly which role can delete (eg admin, however, I would encourage you to think about other users so admins/devs become an achilles heel to the process), all users that don't have the role will not be able to delete or see the UI Action.

 

Below, I've provided an ACL on the Problem table where only users who have the 'itil_admin' or 'problem_admin' role can delete a record. If a user views a Problem without this role, they will not see the 'Delete' button (The UI Action)

Reminder, you'll need to create an ACL for both the 'delete' and 'list_edit' actions.

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.

 

Thanks, Robbie

 

Screenshot 2024-02-06 at 13.45.24.png

Madhan007
Tera Contributor

Hi @Robbie ,I dont want users to delete the records both in form and list. Does that mean I have to edit the existing conditions of the two global "Delete" UI actions, one with form action and one with List action?

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Best way to do so would be to do this via DELETE ACL, Stop it at source and securely and UI actions, form / list will all fall into place, so out of curiosity, why don't you want to take this approach?

 

-Anurag