Skip to main content

Developing with Acumatica's Archiving Feature

  • September 7, 2023
  • 5 replies
  • 847 views

Patrick Chen
Varsity II
Forum|alt.badge.img+2

For those who are unaware, there is a new archiving feature in 2023 R1.  This feature, currently limited to Sales Orders and Shipments, allows users to manually or as a scheduled process set documents as ‘archived’ in the system according to a configured time horizon.  The documents once archived are not deleted, but are labeled as archived.  The purpose of this new feature is to increase performance and not to decrease database size. 

“..Archived documents are not included in the results of database queries executed during regular activities, such as opening generic inquiries, lookup tables, or tabs that load a list of records.  As a result data retrieval performance improves.”  -- Acumatica ERP Administration

As an ISV developer, my team investigated this new feature to determine if our code would be affected.  Interestingly, we found that the logic that governs this feature is at a lower abstraction level than our code.  We discovered that once archived, our PXSelect statements no longer retrieved archived Sales Orders or Shipments. 

Two new columns have been added GotReadyForArchiveAt and DatabaseRecordStatus to the affected tables/DACs.  The first field, a Datetime, lists the date when the document can become archived and the second field DatabaseRecordStatus is a bool that dictates if the document is archived or not.  Once a document is ‘complete’ the GotReadyForArchiveAt date can be set with the current date.  Then when the appropriate time frame has completed, the document can be set to archived.  See the documentation for how to setup and archive data.  The interesting thing is that because of the way this is done, this feature can be applied to DACs outside of the SO and Shipment DACS.  To test this theory, I added the above fields to a custom DAC in my customization, set them both so that my records would read as archived and sure enough the UI did not retrieve them.  My guess is that this mechanism would work universally.

When considering the archiving needs of our own software, it was tempting to utilize this feature.  The question becomes if the data you are archiving would be better marked as ‘obsolete’ or just deleted.

5 replies

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • September 7, 2023

Thank you for sharing this with the community @Patrick Chen!


jharris
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • September 7, 2023

@Patrick Chen - Thanks for this!! I was just looking into this to see if it would be simple enough to customize to add an Sales Order Type selection so we’re not archiving all sales orders. From what you’re saying, it looks like we’ll be able to. 

We want to be able to archive a single sales order type because of retail Shopify orders that have a dedicated order type, but exclude all other order types.  Currently we can’t because it’s all or nothing. It’s also good to know we’re not bound to only sales order and shipment documents!  


Patrick Chen
Varsity II
Forum|alt.badge.img+2
  • Author
  • Varsity II
  • September 7, 2023

@jamesh  Adding the Sales Order Type to the Archiving Process would have been such a good idea!


Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+4

@Patrick Chen 

Thank you Patrick! Not long ago I heard that those records that were marked archived will eventually be part of a different database partition which will increase the performance even more. 


Forum|alt.badge.img+5
  • Semi-Pro III
  • July 29, 2025

This is an excellent idea, and one I have seen often in other products, including the WMS we use.

Any document where the related transactions have all been finalized are a candidate for this.

It seems bad that search functions no longer appear to work on archived documents. That is not good design. The goal of the archiving should not be to blackhole the information, but rather to remove the data from tables where performance is paramount so that data can be queried rapidly and transactions can take place rapidly. In fact, for most query situations, you probably want to have the option to union on the archive table to pull back those results (but due to the archived nature of the information, it should be read only).