Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
TableUtils APIs 'dropAndClean' and 'dropTableAndExtensions' do not delete records in extended tables - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • TableUtils APIs 'dropAndClean' and 'dropTableAndExtensions' do not delete records in extended tables
KB0793442

TableUtils APIs 'dropAndClean' and 'dropTableAndExtensions' do not delete records in extended tables


1115 Views Last updated : Apr 17, 2024 public Copy Permalink
KB Summary by Now Assist

Description

If a table is extended and the APIs TableUtils.dropAndClean or TableUtils.dropTableAndExtensions are used to drop it, broken orphan records will remain in the extended table.
Unique Key Violation Errors may occur when attempting to re-create the dropped table and import these records again. These records will not be accessible from the UI and can only be removed by SN Support engineers from the database directly.

Steps to Reproduce

1. Create a custom table extended from sys_metadata.
2. Create a few new records.
3. Navigate to /sys_metadata_list.do?sysparm_query=sys_class_name=<table_name>.
4. Observe there are records which are accessible.
5. Drop the table using a script like the following:
doDropTable("<table_name>", true);
function doDropTable(table_name, debug){
var table = new global.TableUtils(table_name); // Creates an instance of a TableUtils class.
gs.debug(table_name+" exists? " + table.tableExists());
if (!debug) {
table.dropAndClean(table_name); // Drops a database table and cleans up references to the table
gs.debug(table_name+" exists? " + table.tableExists());
}
}
6. Navigate to /sys_metadata_list.do?sysparm_query=sys_class_name=<table_name>.
7. Observe these records are still present but can not be opened or deleted.

Workaround

This problem is under review and targeted to be fixed in a future release. To receive notifications when more information becomes available, subscribe to this Known Error article by clicking the Subscribe button at the top right of this form.

 


Related Problem: PRB1236062

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.