cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Salim-Satiro
Explorer
0 Kudos

Hi Venkatesan,

Have you found a solution for this ?

Regards,

Salim

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member264639
Participant
0 Kudos

Dear Venkatesan,

No suc tag to cancel the incoming payment on current date exists in B1IF, which is much needed. I have raised this as an Improvement Request to SAP. Request ID: 232790