I am trying to undelete records from deleted records table can anyone help me with a code to this?

karthikg4049566
Giga Contributor

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