Skip to Content
avatar image
Former Member

SAP Business one - B1if - Cancellation of Incoming payments using current System Date

Dear All,

We are trying to cancel incoming payment and other documents using b1if. But, its automatically taking actual document date. How to cancel using system current date using b1if steps.

Options available in DI API, but we require in B1if. Sample DI API Code.

DI API sample:

Incoming :

-------------

// init the Incoming object

OrderApp.oPayments = ((SAPbobsCOM.Payments)(OrderApp.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)));

if (OrderApp.oPayments.GetByKey(1610000275) == true)

{ // If the addition failed

lRetCode = OrderApp.oPayments.CancelbyCurrentSystemDate();

if (lRetCode != 0)

{

OrderApp.oCompany.GetLastError(out lErrCode, out sErrMsg);

}

}

else

{

OrderApp.oCompany.GetLastError(out lErrCode, out sErrMsg);

Interaction.MsgBox(lErrCode + " " + sErrMsg, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); // Display error message

}

Journal :

-------------

OrderApp.oJournal = ((SAPbobsCOM.JournalEntries)(OrderApp.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries)));

if (OrderApp.oJournal.GetByKey(10672) == true)

{ // If the addition failed

OrderApp.oJournal.ReferenceDate = DateTime.Now;

lRetCode = OrderApp.oJournal.Cancel();

if (lRetCode != 0)

{

OrderApp.oCompany.GetLastError(out lErrCode, out sErrMsg);

}

}

else

{

OrderApp.oCompany.GetLastError(out lErrCode, out sErrMsg);

Interaction.MsgBox(lErrCode + " " + sErrMsg, (Microsoft.VisualBasic.MsgBoxStyle)(0), null); // Display error message

}

Thanks & Regards,

Venkatesan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers