Vendor Invoice workflow : workflowtrackingStatusTable.CONTEXTRECID not found in VendInvoiceInfoTable

Question Status

theJoeArnaldo asked a question on 12 Jul 2013 5:32 PM


I am writing a query to pull the workflow approval history for completed vendor invoice approvals.   I understand that the WORKFLOWTRACKINGSTATUSTABLE links to the VENDINVOICEINFOTABLE on WORKFLOWTRACKINGSTATUSTABLE .CONTEXTRECID ==  VENDINVOICEINFOTABLE.RECID.  I am minding the WORKFLOWTRACKINGSTATUSTABLE .CONTEXTABLEID value.    

What I am finding is that many times the WORKFLOWTRACKINGSTATUSTABLE .CONTEXTABLEID does NOT refer to a RECID in the VENDINVOICEINFOTABLE even though the WORKFLOWTRACKINGSTATUSTABLE .CONTEXTABLEID says that there is where it should be found.

I am trying to show the invoice and vendor that the completed workflow applies to and am paying hell to do it.  If you can offer some guidance with this, it would be greatly appreciated.

Thank you,


JoeArnaldo responded on 6 Aug 2013 10:11 AM

We have run into what appears to be a bug in the pending vendor invoice function.

Following are the details :

a) After entering  a pending vendor invoice, and then submitting it -  a duplicate record of the invoice is being created in the VendInvoiceInfoTable.  

b) The duplicate record is not removed until after the Vendor invoice (VendEditInvoice) is closed.  

c) If the VendEditInvoice form is not closed and the approver approves the invoice, the workflow instance record in the WorkFlowTrackingStatusTable is  linked to the duplicate record (WorkFlowTrackingStatusTable.ContextRecId = RecId of the duplicate record in VendInvoiceInfoTable); however, when the VendEditInvoice form is closed the duplicate record is removed, causing the record in the WorkFlowTrackingStatusTable to point to a record in  the VendInvoiceInfoTable that no longer exists.  This causes the workflow history to be orphaned from the vendor invoice that it was created for.

This issue has been duplicated in both an Ax2012 r2 and an AX2012 r2 with CU6 environment.

Has anyone else seen this?



CJ Singh responded on 6 Nov 2015 12:46 PM

hello, was this resolved?

Farokh Bayegan responded on 1 Feb 2016 3:24 PM

I'm facing the same issue and was hoping someone has a solution for this. It looks like the vendinvoiceinfotable recid changes when a workflow is canceled causing the new approved item not to have the same contextrecid as the vendinvoiceinfotable recid

magic1949 responded on 19 May 2016 12:29 PM

We also logged a similar call with Microsoft earlier this year re the duplication on deletion but it is sporadic and not easy to replicate

We corrected but no fix to prevent it recurring.

kartik0603 responded on 11 Aug 2016 12:39 AM

What steps were taken to resolve the issue.?

Kaptan responded on 26 Jul 2017 7:19 AM

Is anyone aware of any workaround or resolution for this issue (KB's).?

This is occurring in AX2012 R2 CU7 also!