on 2022 Nov 26 3:06 PM
I need to create Outgoing Payment Draft for the A/P Invoice. i am getting the following error...help me to resolve this..." Invalid document number [VPM2.DocEntry][line: 1] "
My Code is here...
SAPbobsCOM.Payments oPayment;
oPayment = Global.oCompany.GetBusinessObject(BoObjectTypes.oPaymentsDrafts);
oPayment.DocObjectCode = BoPaymentsObjectType.bopot_OutgoingPayments;
oPayment.DocType = BoRcptTypes.rSupplier;
oPayment.CardCode = CardCode;
oPayment.BPLID = Branch;
oPayment.Invoices.DocEntry = Convert.ToInt32(ApInvoiceNo);
oPayment.Invoices.Add();
//Bank Transfer
oPayment.TransferSum = Amount;
oPayment.TransferAccount = AcctCode;
oPayment.TransferDate = DateTime.Now;
int add=oPayment.Add();
Hi dinesh.s1,
Following sample code works fine in the DEMO database on FP2202:
SAPbobsCOM.Payments oIPD = (SAPbobsCOM.Payments)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPaymentsDrafts);
oIPD.DocType = SAPbobsCOM.BoRcptTypes.rSupplier;
oIPD.CardCode = "V10000";
oIPD.DocDate = DateTime.Today;
oIPD.TransferAccount = "161000";
oIPD.TransferSum = 23;
oIPD.TransferDate = DateTime.Today;
oIPD.TransferReference = "T123456";
oIPD.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_OutgoingPayments;
oIPD.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_PurchaseInvoice;
oIPD.Invoices.DocEntry = 706;
oIPD.Invoices.SumApplied = 23;
int ADPDF = oIPD.Add();
Hope it helps!
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi dinesh.s1,
Glad to know that the issue has been resolved.
Kindly help to close the thread.
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
User | Count |
---|---|
91 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.