Skip to Content
0

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

Dec 13, 2016 at 09:58 AM

137

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
Former Member

Hi Venkatesan,

Have you found a solution for this ?

Regards,

Salim

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers