AX 2012 Vendor Invoice workflow : workflowtrackingStatusTable.CONTEXTRECID not found in VendInvoiceInfoTable


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,


Hi Arnaldo,

I am also facing the same problem !!

ContextTableId is different from RecId. ContextTableID refers to the tables id of the VendInvoiceInfoTable and ContextRecId refers to the related record id in the VendInvoiceInfoTable (in this case).

Have a look at \Data Dictionary\Tables\PurchTable\Methods\workflowLastComment