How to Retrieve large number of deleted records

vtred
Tera Contributor

Management asked me to deleted 10,000 Records and now they want them back.

I went to Deleted Records module and saw the records exist: but here, its hard to keep selecting 200 records at once and undelete the records.

Is there any other way to retrieve all those records at once?

7 REPLIES 7

vtred
Tera Contributor

Thank you Nathan, this works perfect but:



When i keep the filters on the audit table as one particular date when the records were deleted: 20th of this month



var deleted = new GlideRecord('sys_audit_delete');


deleted.addEncodedQuery('sys_created_onON2017-08-11@javascript:gs.dateGenerate('2017-08-20','start')@javascript:gs.dateGenerate('2017-08-20','end')');


deleted.query();


while(deleted.next()){


var x = deleted.getRowCount();


}


gs.print(x);




Here i get this ERROR: ERROR at line 2: Expected ')' and instead saw '2017'.



How do i get rid of this error? though the query is copied from the Breadcrumbs


deleted.addEncodedQuery("sys_created_onON2017-08-11>javascript:gs.dateGenerate('2017-08-20','start')>javascript:gs.dateGenerate('2017-08-20','end')");



now you will not get an error. please make sure what have you build in encoded query.


vtred
Tera Contributor

Thank You All