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

Overlapped I/O operation is in progress (incomingpayments)

Hello All:

I am creating a addon that create incoming payment per invoice. And alot of time it's partial payments. Below is a sample of my code. All payment are made in cash. and it's paid to invoices and not to account.

I am keep on getting the Overlapped I/O operation is in progress (-2028) error message. But have no idea why, tried different things without help. Does anyone have a working sample or any experience with this?

Thank You!

opay = (SAPbobsCOM.Payments)(Global.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments));

opay.CardCode = Cardcode.ToString();

opay.DocDate = System.DateTime.ParseExact(row["paymentdate"].ToString(), "yyyyMMdd", null);

opay.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;

opay.DocTypte = SAPbobsCOM.BoRcptTypes.rCustomer;

if (row["reference"].ToString().Length > 8)

{

opay.CounterReference = row["reference"].ToString().Substring(0, 8);

}

else

opay.CounterReference = row["reference"].ToString();

opay.CashSum = amount;

opay.Reference1 = row["receiptno"].ToString();

opay.Invoices.DocEntry = System.Convert.ToInt32(docentry.ToString());

opay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;

opay.Invoices.SumApplied = amount;

opay.Invoices.Add();

if (opay.Add() != 0)

{}

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2007 at 09:04 PM

    Has any one got any sample of working incoming payment similar to this kind of situation? If I do accords to invoice with just a cashsum it works. But if I link it to a invoiceno. It doesn't. I don't know why!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 07:09 PM

    Somehow this works.

    opay = (SAPbobsCOM.Payments)(Global.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments));

    opay.CardCode = Cardcode.ToString();

    opay.DocDate = System.DateTime.ParseExact(row["paymentdate"].ToString(), "yyyyMMdd", null);

    opay.DocType = SAPbobsCOM.BoRcptTypes.rCustomer;

    if (row["reference"].ToString().Length > 8)

    {

    opay.CounterReference = row["reference"].ToString().Substring(0, 8);

    }

    else

    opay.CounterReference = row["reference"].ToString();

    opay.Reference1 = row["receiptno"].ToString();

    opay.Invoices.DocEntry = System.Convert.ToInt32(docentry.ToString());

    opay.Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_Invoice;

    opay.Invoices.SumApplied = amount;

    opay.Invoices.Add();

    opay.CashSum = amount;

    if (opay.Add() != 0)

    {}

    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.