on 2012 Apr 18 12:59 AM
I am trying to create an outgoing payment against an existing open AR Credit Memo. Here's my code - getting "No matching records found". Note that the payment is applied against 1 AR credit memo and it consists of two credit card entries (ignore cc numbers and exp dates)
Please let me know what I am doing wrong. Thanks!
Dim creditMemoDocentry as Integer
creditMemoDocentry=445 'this is the docentry of the credit memo
oPmt = vCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)
oPmt.DocType = SAPbobsCOM.BoRcptTypes.rCustomer
oPmt.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_OutgoingPayments
oPmt.CardCode = "C1234"
oPmt.DocDate = docDate
oPmt.DueDate = docDate
oPmt.CashSum = 100
oPmt.CashAccount = "_SYS00000000001" '// this is my cash account - I
'oPmt.Invoices.Add() //Note - this line is commented out.
oPmt.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_CredItnote
oPmt.Invoices.DocEntry = creditMemoDocentry
oPmt.Invoices.DocLine = 0
'Adding credit cards
oPmt.CreditCards.CreditCard = 2
oPmt.CreditCards.CreditCardNumber = "12345"
oPmt.CreditCards.CardValidUntil = Month(Now) & "/" & Year(Now)
oPmt.CreditCards.VoucherNum = "0"
oPmt.CreditCards.CreditSum = 20
oPmt.CreditCards.Add()
oPmt.CreditCards.CreditCard = 3
oPmt.CreditCards.CreditCardNumber = "12345"
oPmt.CreditCards.CardValidUntil = Month(Now) & "/" & Year(Now)
oPmt.CreditCards.VoucherNum = "0"
oPmt.CreditCards.CreditSum = 32
If oPmt.Add() <> 0 Then
Call vCmp.GetLastError(nErr, errMsg)
If (0 <> nErr) Then
MsgBox("Error creating Ougoing Payment ex: " & nErr & " " & errMsg)
End If
End If
We're the same error.
I'm creating also a add-on the will post it on Outgoing payment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
106 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.