Facing issues while re - archiving records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 03:07 AM
Hi All,
I have an archive rule to archive a records in a table along with the related lists. Using Archive rule archiving is working fine. Records are removed from the base tables and moved to archive tables. Iam also able to restore the archived records and related records using the related link ' Restore record and related records.
But after restoring the records iam not able to re-archive the records ,using the related link 'Archive Record' . After clicking the link, iam still able to find the record in base table. Its not removed from the base table.
Even tried background script for rearchiving the record.
var gr = new GlideRecord('tablename');
gr.addQuery('sys_id','sys_id');
gr.query();
while(gr.next()) {
gs.print('Archiving record with number: ' + gr.number);
try{
new GlideArchiveRecord().archive(gr);}
catch(err) {
gs.log('Error returned is: ' + err);
}
}
But getting error "*** Script: Error returned is: java.lang.NullPointerException"
Any suggestions on why its not getting re-archived ?
Thanks in Advance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 10:54 PM
Hey,
Check below SN article to guide you:
Unable to bulk re-archive restored records
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2022 11:21 PM
Hi Aman,
I tried with the same conditional script in the SN article to rearchive record.But its not working , still getting nullpointerexception error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2023 07:49 AM
Hi, was there ever any resolution to this issue? I am encountering the same problem. thank you, --Brian