Im trying to complete a payment originated from a manual entry, through SDK. Problem is, among the SDK objects, we have not found out how to link the entry reference document to this payable. Business One does not allow us to complete a payment whose origin is a manual entry, it only accepts this when the origin is an invoice! How do we proceed in this case?
Example for Manual Entry (does not work):
Dim oPays As SAPbobsCOM.Payments
oPays = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)
oPays.CardCode = "F05550662000159"
oPays.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_OutgoingPayments
oPays.DocType = SAPbobsCOM.BoRcptTypes.rSupplier
oPays.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_JournalEntry
oPays.Invoices.DocEntry = 200
oPays.Invoices.SumApplied = 500
oPays.DocDate = Now
oPays.JournalRemarks = "pag efect"
oPays.TaxDate = Now
oPays.TransferAccount = "5.1.2.01.0003"
oPays.TransferDate = Now
oPays.TransferReference = "ref01"
oPays.TransferSum = 500
If oPays.Add() <> 0 Then
'MsgBox(oCompany.GetLastErrorDescription)
oCompany.GetLastError(ErrCode, ErrMsg)
MsgBox(ErrCode & " " & ErrMsg)
End If
Tank´