web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

delete all transactions in AX 2012 database?

(0) ShareShare
ReportReport
Posted on by 5,990

Hi, Could some one provide me a solution how i can clear all transactions from the AX 2012 system - I am using a test database, however, I need to clear all the trans so I can use this as a production.  Appreciate it someone can provide a solution

there seems to be a class - but I don't know how to execute them.

in Ax there is a class "SysDatabaseTransDelete ". Theses class deletes all transactions currently in the system.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Malcolm Burtt Profile Picture
    1,475 on at

    Hi

    The SysDatabaseTransDelete class deletes all data from tables in the Transaction, WorksheetHeader and WorksheetLine table groups plus the following tables...

           SalesTable

           PurchTable

           WMSPallet

           CustInterestJour

           CustCollectionLetterJour

           ProjControlPeriodTable

           ProjInvoiceJour

           ProjJournalTable

           PdsRebateTable

           PdsBatchAttributes

    Note that it does not remove main or table group data so your basic system setup will still be intact after your run it.

    You can run it from the AOT by right clicking on the SysDatabaseTransDelete class node and selecting "open" - this isn't the sort of thing you would want to put on a menu anywhere. :-)

    Malcolm Burtt
    K3 Retail
    Blog: www.k3technical.com

  • ewills Profile Picture
    5,990 on at

    Hi Malcolm, thanks. It deleted the transactions. However, trial balance still shows the data and from what I see, this class doesn't delete the general journal header/transactions tables. How to clear them so the trail balance shows 0.0  

  • David Bader Profile Picture
    on at

    Hello,

    If you are using the SysDatabaseTransDelete class you should be on AX 2012 CU3. Prior to CU3 the class was not updated to work with the new database structure in AX 2012 as it was originally designed for AX 4.0.

    I hope this information is helpful to you. Please post back if the Community can be of futher assistance.

    Have a great day!

    Dave B.

  • ewills Profile Picture
    5,990 on at

    Hi David,I am on the FeaturePack but didn't intall the CU3. please advise.

  • David Bader Profile Picture
    on at

    Hello,

    You can get CU3 from the following location.

    mbs2.microsoft.com/.../KBDisplay.aspx

    Once that is installed then the SysDatabaseTransDelete class should work as expected.

    Have a great day!

  • Rudi Yanto Profile Picture
    10 on at

    can I use in AX 2012 R2 CU 6 ?  I see on number sequence not rollback to the first ?

  • Suggested answer
    Muhammad Saad Profile Picture
    990 on at

    Run Initialize & Rebuilt balances for all Dimension sets that you have created, this will adjust you TB.

    Regards

    Muhammad Saad

  • Community Member Profile Picture
    on at

    Hi Saad,

    We've done the initialize and rebuilt balance, but TB was not refresh well.

    perhaps we missed one / two steps, would you mind to tell us more detail ?

    Best REgards,

    Afin

  • Community Member Profile Picture
    on at

    Use this job to delete all transaction in the current company

    static void deleteTransactions(Args _args)
    {
    SysDatabaseTransDelete delete;
    ;
    delete = new SysDatabaseTransDelete();
    delete.run();
    }

  • ninzer Profile Picture
    650 on at

    where to run the job - is it from AOT? I don't see the below

    static void deleteTransactions(Args _args)
    {
    SysDatabaseTransDelete delete;
    ;
    delete = new SysDatabaseTransDelete();
    delete.run();
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans