Ankur Bawiskar
Tera Patron

Many a times there occurs a scenario that users create a custom table within an installed Scoped System Application and are unable to delete that.

Use case: For example If you create a custom table in Human Resources: Core, it is not possible to delete that - the Delete button is not visible. So although this table doesn't serve any purpose it would still reside in the instance. The "Delete All Records" button is visible but even after user deletes all the records from the table, the Delete Table button is not available.

This issue is proposed to be fixed in Quebec version. Till then users can use below solution/workaround to delete the custom table.

Note: This use case can occur with any custom table created within any Scoped System Application and not just to Human Resources: Core. The blog has taken Human Resources: Core for example purpose.

KB Article: https://hi.service-now.com/kb_view.do?sysparm_article=KB0623901

Solution: You can use below script and run in scripts background in global scope. Ensure you put your table name

var tableDeletion = new TableUtils();
tableDeletion.dropAndClean('<your table name here>');

Note:

  • Running this script will permanently delete table and all its data.

Screenshots:

1) Table being created in Human Resources: Core application and Delete button is missing

find_real_file.png

2) Scripts Background: Script to run in global scope; mention your table name

find_real_file.png

3) After running the script;

find_real_file.png

4) Table doesn't exist

find_real_file.png

Thanks for reading the blog and do provide your inputs/suggestions if any.

Hope you find this article helpful. Don’t forget to Mark it Helpful, Bookmark.
Thanks,
Ankur Bawiskar

ServiceNow MVP 2020,2019,2018

My Articles & Blogs

 

Comments
Kilo Sage

Thanks for writing this up - saved me a headache!

The KB now states they're targeting Rome for a fix.  I'll be curious to see how many versions it gets pushed off.

Tera Contributor

Very helpful, thank you. Wouldn't have figured this out without this documentation. SN Docs does not state this. 

ServiceNow Employee
ServiceNow Employee

Thank you for sharing.

Tera Contributor

Hi All,

 

I have a little bit different problem instead of table I have to remove specific tab from incident form. It was created in scoped application but that application got uninstall. That tab still on the form in global scope. How to remove it?

 

Kilo Sage
Kilo Sage

@Mukul9 

 

I have a solution for you. 

This can be done via xmls. I have faced the same issue and resolved it by doing the changes ob xmls and took the xml of the following

 

 

Sys_form

Sys_form_ui_section

Sys_ui_section

 

I will ping you the detailed xmls here shortly

 

 

 

Kilo Sage
Kilo Sage

@Mukul9 

 

You can make the deletion changes by following the below sequence for form or form element deletion for global app:

You can follow the below sequence and do the deletion accordingly.

 

  1. sys_ui_form_bd0a46a81b73a99d80999604bcbb0
  2. sys_ui_section (name=x_table_name^view=Default view)
  3. sys_ui_form_section (sys_ui_form=bd0a1b79999046d80d06604bcbb0)
  4. sys_ui_element (sys_ui_section.sys_scope=6de5d0899932adc4ea715604bcb55^sys_ui_section.sys_dom)

.

 

By this way, you can decide what to keep and what to delete by comparing diff environments

 

 

Thanks,

Shamma