Wednesday, August 5, 2015

AX 2012 Workflow Batch Job "Failed to find workflow" error

AX 2012 workflow batch job fails with the error "Failed to find workflow" message.

To resolve the error find the Record which is in queue and causing the issue and update MessageLifeCycleState to 2.

The below code will give you the record which is causing the error.
SYSWORKFLOWMESSAGETABLE SYSWORKFLOWMESSAGETABLE;
SYSWORKFLOWTABLE SYSWORKFLOWTABLE;

while Select RECID from SYSWORKFLOWMESSAGETABLE 
    Where SYSWORKFLOWMESSAGETABLE.MESSAGELIFECYCLESTATE == 1  && SYSWORKFLOWMESSAGETABLE.ROOTCORRELATIONID
notexists join SYSWORKFLOWTABLE 
    where SYSWORKFLOWMESSAGETABLE.RootCorrelationId == SYSWORKFLOWTABLE.RootCorrelationId
    {
        info(strFmt("%1",SYSWORKFLOWMESSAGETABLE.RecId));

    }


No comments:

Post a Comment