Deleting multiple domain records
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-18-2023 10:10 PM
Deleting domain records is a slow process where it trigger domain hierarchy job everytime.
Is there a way to quickly delete all the domains from the domain table?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2023 04:35 AM
Hi @Mrigank Gupta1!,
I don't know much about the domain module, but have you tried to delete it with a fix script? It might be very risky to do this because the delete has a property of cascading and you could delete all related table records.
var domainTable = 'cmn_domain'; // Adjust the table name if needed
// Create a GlideRecord query to get all domain records
var domainRecords = new GlideRecord(domainTable);
domainRecords.query();
// Delete each domain record
while (domainRecords.next()) {
domainRecords.deleteRecord();
}
gs.info('Deleted all domain records from ' + domainTable);