cancel
Showing results for 
Search instead for 
Did you mean: 

Overlapped I/O operation is in progress (incomingpayments)

Former Member
0 Kudos

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 > 😎

{

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)

{}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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 > 😎

{

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)

{}

Former Member
0 Kudos

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!