I want to remove the delete option on the table list view for a scoped application

Community Alums
Not applicable

I am trying to remove delete option from actions on selected item in the list view  i tried below option by creating an ui action but it is not working

find_real_file.png

5 REPLIES 5

shloke04
Kilo Patron

Hi,

Please follow the steps below to achieve your requirement:

1) This Delete gets visible due to the below UI Action which is written on the Global table

https://instance.service-now.com/nav_to.do?uri=sys_ui_action.do?sys_id=75a1fcce0a0a0b3400d6ed99cf8a87e0


Replace "instance' with your instance name.

2) First you need to override this Delete button so that this requirement of yours should not affect other tables or functionality in ServiceNow

3) Open the above UI Action as per link provided and just change the Table name to your Custom table Name and then Right click on the Header and do Insert and stay as shown below I have done this for Incident:

4) Now once this is done, you can modify the condition of the new UI Action say you want to make this button visible only to admins from List view then modify it as below:

current.canDelete() && gs.hasRole('admin')

 

Please change your role to the role you want as per your requirement.

 

Output:

Delete Button is not available and is greyed out for ITIl users from List view:

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Community Alums
Not applicable

will it work for scoped application table as well?

because it is throwing errors like 'DeleteRecordAjax' script includes are not in scoped application.

Hi,

Please follow the approach mentioned in the HI Article created by ServiceNow for achieving this in Scoped Applications:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0692665

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Community Alums
Not applicable

 when i select delete button, deleting of records is not working after insert and stay of the delete global ui action