
Hello,
I've written some code which creates thru X++ vendor invoices in the VendInvoiceInfoTable table.
These invoices are not programmatically psoted.
Instead they can be reviewed with in pending invoices screen (Accounts payables - Common - Vendor invoices pending vendor invoices).
If I open the invoice to review it on screen and use the Post button, the vendor transactions is updated correctly (VendTrans table)
If i post directly from the epnding vendor invoices listpage... nothing is posted! Nothing shows up in VendTrans and even worse, the invoice is deleted from VendInvoiceInfoTable! No errors is reported by AX.
If anyone has an idea, please let know!
Regards,
Eric
*This post is locked for comments
I have the same question (0)Hmmm, finally figure it out, if anyone is interested read on... :)
VendInvoiceInfoListPage and VendEditInvocie don't behave quite exactly the same way before doing the actual posting.
The process launched by VendInvoiceInfoListPage will check if the table VendInvoiceInfoSubTable (linked to VendInvoiceTable) has records match the invoice being posted. If it does not, it deletes the VendInvoiceInfoTable record! Since my invoice creation is not applied to invoices made from P.O., I didn't put much care into VendInvoiceInfoSubTable, especially since where using this used to create invoice reversals, so the P.O. shouldn't be of any concern.
Bad thinking...
VendEditInvoice does not try to delete an invoice if it does not have at least one matching VendInvoiceInfoSubTable record.
I've changed my code to create the related VendInvoiceInfoSubTable and the invoice can now be posted from either forms.
PS: If you were not interested but still read it up to here, hope you had a good reading! :)