on 02-07-2006 10:25 PM
Hi,
I am trying to add Outgoing payment based on an invoice through the DI API but I got an error"[OACT] , 'No matching records found (ODBC -2028)". I was just using the SAP Business One 2005 Demo data to set all the value. The C# code is below:
public static void AddOutgoingPayment(SAPbobsCOM.Company company){
SAPbobsCOM.Payments vPay = (SAPbobsCOM.Payments) company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments);
vPay.CardCode = "V23000";
vPay.CardName = "Anthony Smith";
vPay.Address = "1901 Maynesboro Drive, Suite 200, Camden PA 19065, USA";
vPay.JournalRemarks = "Outgoing - V23000";
vPay.DocDate = DateTime.Today;
vPay.DocType = SAPbobsCOM.BoRcptTypes.rSupplier;
vPay.CashSum = 100000;
vPay.DocCurrency = "USD";
vPay.CheckAccount = "_SYS00000000002";
vPay.DocObjectCode = SAPbobsCOM.BoPaymentsObjectType.bopot_OutgoingPayments;
//Purchase Invoice
vPay.Invoices.DocEntry = 21;
vPay.Invoices.DocLine = 0;
vPay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_PurchaseInvoice;
vPay.Invoices.SumApplied = 100000;
//Check
vPay.Checks.AccounttNum = "100-3443-7867";
vPay.Checks.BankCode = "BOA";
vPay.Checks.Branch = "54";
vPay.Checks.CheckNumber = 389;
vPay.Checks.CheckSum = 100000;
vPay.Checks.Details = "Check";
vPay.Checks.DueDate = new DateTime(2006,3,1,0,0,0,0);
int returnVal = vPay.Add();
int errCode;
string errMsg;
if(returnVal != 0){
company.GetLastError(out errCode, out errMsg);
string msg = string.Format("Error Code: {0}; Error Message: ", errCode, errMsg);
Console.WriteLine(msg);
return;
}
Console.WriteLine("Successfully Add outgoing payment!");
}
}
I am confused why I get this error and would appreciate if anyone can help me out.
Thank you in advance,
Sunny
Hi there,
did you solve your problem? How?
I've got the same message and can't figure out the mistake...
Thanks,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sunny,
The quickest way to resolve this may be to try and enter the transaction manually using the same data you are testing in code. It looks like there's incomplete company setup (my guess is GL account determination but it could be a number of things).
If you can enter the transaction manually then you are not populating all required fields in code before attempting to add it.
Hope this helps,
Owen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.