cancel
Showing results for 
Search instead for 
Did you mean: 

Outgoing payments against AR Credit Memos

simonsimonian
Participant
0 Kudos
306

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

We're the same error.

I'm creating also a add-on the will post it on Outgoing payment.

Former Member
0 Kudos

Hi experts please share some idea regarding this one. We're the same problem.

simonsimonian
Participant
0 Kudos

I've actually figured this out myself. The problem is that with outgoing payments you also need to set the GL account. So just set this and it should work. cheers!

 

oPmt.CreditCards.CreditAcct