Okay, I've read up on the manual and did a bit of code. Everything is somewhat working but I'm running into a little bit of a different problem now. Validation works fine for all posted invoice numbers but fails to work for unposted invoices that are still in "work" as they somehow are not recognized . Is there another table for invoices that have not been posted yet? This is my final code if anyone might need it later. Dim CustomerMasterTableID As PmPaidTransactionHistTable Dim CustomerMasterInvoiceVendor As PmPaidTransactionHistTable Dim TabErr As TableError Dim VendErr As TableError CustomerMasterTableID = Dynamics.Tables.PmPaidTransactionHist CustomerMasterInvoiceVendor = Dynamics.Tables.PmPaidTransactionHist ' Find the proper keys CustomerMasterInvoiceVendor.Key = 1 CustomerMasterTableID.Key = 3 ' Used Vendor and Invoice to symbolize the two variables that I was looking for; vendorname and invoicenumber. CustomerMasterTableID.DocumentNumber.Value = invoice CustomerMasterInvoiceVendor.VendorId.Value = VendorId 'Retriving the error TabErr = CustomerMasterTableID.Get() VendErr = CustomerMasterInvoiceVendor.Get() If TabErr = TableError.NoError And VendErr = TableError.NoError Then Error 123 Else End If CustomerMasterInvoiceVendor.Close() CustomerMasterTableID.Close()
↧