Sunday, October 30, 2011

Increase performance of workflow process in AX 2009 / delete obsolete workflow data in AX 2009

Hi Folks,

Recently, For a customer, I have observed that the workflow processing has become very slow then when i have observed the workflow batch job history, I have found that there are many errors and it says "The company 'tst' does not exist". But this company has been deleted long back.

As we know, In AX 2009, If a company is deleted then all the records with respect to that company will be deleted except the records in the Workflow tables(WorkflowTrackingTable, WorkflowTrackingStatusTable, WorkflowMessageTable). These records have to be deleted via SQL, If these records are not deleted then every time when the workflow batch job is running then everytime it checks those obsolete records too and hence the performance of workflow processing is reduced, because the workflow batch job will always tries to process those obsolete records.

Remember to run the following queries in SQL, if you have deleted a company which has workflow records. This would definitely increase the Workflow performance.


delete from WorkflowTrackingTable where WorkflowTrackingTable.CONTEXTCOMPANYID == 'TST' 

delete from WorkflowTrackingStatusTable where WorkflowTrackingStatusTable.CONTEXTCOMPANYID == 'TST'

delete from workflowmessagetable where workflowmessagetable.WORKFLOWCONTEXTCOMPANYID == 'TST'

Happy DAxing..............

No comments: