Skip to Content
author's profile photo Former Member
Former Member

Error Code: -2028 :[OACT] , 'No matching records found (ODBC -2028)'

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Feb 07, 2006 at 10:54 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 02:50 PM

    Hi there,

    did you solve your problem? How?

    I've got the same message and can't figure out the mistake...

    Thanks,

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.