This is my code for creating Outgoing Payment.
-
Dim payment As SAPbobsCOM.Payments = SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)
payment.DocDate = Date.Now
payment.CardCode = "Testing"
payment.PayToCode = "Testing PTD"
payment.DocType = SAPbobsCOM.BoRcptTypes.rCustomer
payment.IsPayToBank = SAPbobsCOM.BoYesNoEnum.tNO
payment.CashSum = 15
payment.CashAccount = 123456
if payment.Add() 0 Then
oWrite.WriteLine(SBO_Company.GetLastErrorDescription)
oWrite.WriteLine("Add Outcoming Payment: Record Fail")
end if
-
Question:
When the CashSum is 15, the AddOn will have an error message: Data cannot be empty in one of the tables Doc1, Doc3, Doc10. http://VPM2.InvoiceIdline: 0
But When the CashSum is changed to 50, the outgoing payment can successfully create.
Do the code have any problem to make this error?
SAP Version: SAP Business One Verison 2005B Patch 35