Hello,
I am trying to process purchase order invoices via x++. I read the data from a text file and then put this data in a temp table in AX. I then read from the Temp table to creaate and post the invoice. One of the routines I have is to check and see if the invoice has already been processed. I am using the routine below. There seems to be occasions where the RemainAmountCur will return a value that is not zero even if it is already paid in AX.
select firstOnly * from vendTrans where vendTrans.AccountNum == NewInvTable.VendorId &&
vendTrans.Invoice == NewInvTable.InvoiceId
{
if (vendTrans.remainAmountCur() == 0)
{
// Skip this record a s there is no remaining amount
}
}
My question is, am I using the right method to determine if the invoice has already been entered and/or process or is there a better way?
Thanks,
Shawn