19 November 2014

Delete Transactional Data in a company

There is a class in AX that helps deleting transactional data. You'll find it in the AOT (Ctrl + D) in the classes node: SysDatabaseTransDelete.
Run this class by opening the main method and press (F5). It will prompt you to delete transactions in the current company.

 It will delete all tables with tablegroup:
  • Transaction
  • WorksheetHeader
  • WorksheetLine 
  • Except (CustCollectionLetterLine, InventDim, DocuRef, DirPartyRelationship). 
It will skip all global tables expect (SpecTrans and GeneralJournalEntry).
In addition to the transactional tables it will delete:
  • SalesTable 
  • PurchTable 
  • WMSPallet 
  • CustInterestJour 
  • CustCollectionLetterJour 
  • ProjControlPeriodTable 
  • ProjInvoiceJour 
  • ProjJournalTable 
  • PdsRebateTable 
  • PdsBatchAttributes 
 The execution takes a while depending on the amount of transactional data in the current company.

No comments: