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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Suggested Answer

Workflow history cleanup

(0) ShareShare
ReportReport
Posted on by 50

Hi All,

Let me post another query regarding with AX2009 workflow. Is there anyway to clean up the workflow history? We are not sure how many tables we have to look at. 

We are reluctant to do that because we are having a lot of workflow error (deadlock, fail to find workflow, duplicate workflow steps, etc). So, we are afraid that deleting records from workflow table would make more orphanage records in WorkflowMessageTable.

If you have any idea or experience, kindly share as we are facing the same issue everyday with our AX09 clients.

thanks.

Regards,

Yuan

*This post is locked for comments

I have the same question (0)
  • krishna.rao@dax Profile Picture
    3,008 on at

    Test the below script with limited lines and proceed if it works.

    delete_from WorkflowTrackingStatusTable

    where WorkflowTrackingStatusTable.TrackingStatus ==    

                     WorkflowTrackingStatus::Completed &&

                        WorkflowTrackingStatusTable.WorkflowType ==

                                WorkflowTrackingStatusWorkflowType::Workflow &&

                       WorkflowTrackingStatusTable.modifiedDateTime <

                               DateTimeUtil::addMonths(DateTimeUtil::utcNow(),-3);

    delete_from WorkflowTrackingStatusTable

    where WorkflowTrackingStatusTable.TrackingStatus ==

                     WorkflowTrackingStatus::Cancelled &&

              WorkflowTrackingStatusTable.WorkflowType ==  

                     WorkflowTrackingStatusWorkflowType::Workflow &&

             WorkflowTrackingStatusTable.modifiedDateTime <

                    DateTimeUtil::addMonths(DateTimeUtil::utcNow(),-3);

  • Suggested answer
    Riaz Ahmad Profile Picture
    104 on at

    Run batch job Administration > Periodic > Notification clean-up and include this job as a part of your maintenance plan.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans