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)
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,006 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

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