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)

how to delete transaction data ?

(0) ShareShare
ReportReport
Posted on by 3,518

hello to all , 

in ax 2012 we want to delete all the transaction happened till date . kindly help me out on this concern .

i will wait for your suggestions .

thanks :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    Do you want to delete all transaction in a company. If so,please check this:

    us.hitachi-solutions.com/.../dynamics-ax-delete-transactions-company

  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    Hi Paras mehan

    you can use clsass sysdatabasetransdelete  for every legal entity

  • Paras mehan Profile Picture
    3,518 on at

    Hi Visvash,

    Thanks for prompt reply.

    Similar we need but we need to delete data between a time internal, as SysDatabaseTransDelete class will delete entire trans data

  • Paras mehan Profile Picture
    3,518 on at

    Hi Mahmoud ,

    Thanks for getting back .

    We need to delete data between a time internal, as SysDatabaseTransDelete class will delete entire trans data.

    Kindly suggest me

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    I don't think it exists in the standard. Can you let us know what sort/kind of transactions are you looking to delete.

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    In that case you have to write your own scripts .If you see class sysdataBaseTransDelete they are using dictionary class and go by tablegroup to find tables and finally use

    "delete_From common" statement in deletetable method  to delete data , You can modify this statement and include your time interval

    delete_from common

               where Common.ModifiedDateTime >= FromDate

                   && Common.ModifiedDateTime <= ToDate;

    Also make sure you use your dev environment for such a testing and do take database backup before executing this class , in case anything goes wrong and you need data.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Your request is not feasible. There is no universal way of determining when a transaction was specifically generated in such a granular relational database. Every table has a different date for that, like Created/ModifiedDateTime, TransDate, InvoiceDate, financial or physical posting date, and a dozen more. It would be extremely complex to write date range-based delete criteria for those.

    So you either delete all, or your request cannot be achieved in a straightforward manner.

  • Weaveriski Profile Picture
    23,620 Moderator on at

    What are you trying to achieve? With the relational databasse structure, the related tables and transactions the requirement here is huge, but I see no real reason you would want to do this - can you explain more because the solution would be to look at each transactional table individually, analyse the date relation, decide what you want and write scripts for each table - I am sure there are rules you could make on related tables but it really is not that simple, look at Fixed Assets, GL balances, Costing, Production over periods, Projects over period, sales orders processed from initial transaction of entry through to payment and the same for purchase requisition through purchase order, receipt, invoice and payment across a period. I have not even mentioned elements like advanced warehousing, the list goes on.

  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi Paras Mehan,

    Date field in different tables may have different name or may not exists at all, so this is not possible. You have to write your own code to delete data you want.

  • guk1964 Profile Picture
    10,888 on at

    I doubt it could sensibly be done for an interval -what if a transaction crosses the interval?

    If its to delete all transactions for the last week/month then it would be simpler to restore the relevant last good back up..

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