cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid document number [VPM2.DocEntry][line: 1]

former_member695428
Discoverer
0 Kudos

I want to create an outgoing payment after the A/P invoice created with Cash as a payment means using di API.

I have added the following code in the Form_DataAddAfter event of A/P invoice.

But it throws an error "Invalid document number [VPM2.DocEntry][line: 1] ".

Payments oVendorPay = (Payments)oCompany.GetBusinessObject(BoObjectTypes.oVendorPayments); oVendorPay.CardCode = "Vendor Code"; // A/P invoice vendor code

oVendorPay.Invoices.Add();

oVendorPay.Invoices.DocEntry=Convert.ToInt32(UIAPIRawForm.DataSources.DBDataSources.Item(0).GetValue("DocEntry", 0)); // last added a/p invoice doc entry

oVendorPay.Invoices.InvoiceType = BoRcptInvTypes.it_PurchaseInvoice;

oVendorPay.Invoices.SumApplied = 100;

oVendorPay.CashAccount = "account code";

oVendorPay.CashSum = 100;

ioVendorPay.Add()

Please anyone kindly help to solve this problem

0 Kudos

have you fixed this error? I encountered the same problem

dinesh_s1
Participant
0 Kudos

I am facing the same error... any solution for this??

Accepted Solutions (0)

Answers (0)