Facing issues while re - archiving records

Elizabath1
Tera Contributor

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.

find_real_file.png

 

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.

find_real_file.png

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

3 REPLIES 3

Aman Kumar S
Kilo Patron

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 🙂

Best Regards
Aman Kumar

Hi Aman, 

I tried with the same conditional script in the SN article to rearchive record.But its not working , still getting nullpointerexception error. 

bclemen
Tera Contributor

Hi, was there ever any resolution to this issue?  I am encountering the same problem.  thank you,  --Brian