I am trying to undelete records from deleted records table can anyone help me with a code to this?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 12:32 AM - edited 03-15-2024 12:33 AM
There are more than 6809879 records to be recovered
And can i use the code below
var deleted = new GlideRecord('sys_audit_delete');
// Add an encoded query to filter the records you want to undelete
deleted.addEncodedQuery('tablename=cmdb_ci_network_adapter');
// Query the records
deleted.query();
// Loop through the results and undelete each record
while (deleted.next()) {
new GlideAuditDelete().undelete(deleted.sys_id);
}
0 REPLIES 0