cancel
Showing results for 
Search instead for 
Did you mean: 

(Help Required) Insert / Update Primary Form Item in (Journal Voucher or Journal Entry) using DiApi

rahuljain257
Participant
0 Kudos
628

Hello Everyone,

While adding / Updating JournalVoucher using SAPDIAPI, application is getting crashed !!! Please look into this issue & suggestion me some solution :-

The below line crashes while adding Journal Voucher ==> Property ==> "Primary Form Item"

objSDocuments.JournalEntries.Lines.PrimaryFormItems.CashFlowLineItemID = objHeader.PrimaryFormItemId; (Primary form Item)

SAP BUSINESS ONE 9.2 PL 08

SAPbobsCOM.JournalVouchers objSDocuments= (SAPbobsCOM.JournalVouchers)oCmpy.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalVouchers);

objSDocuments.JournalEntries.Series = Convert.ToInt32(objGeneralLedgerManager.GetSeries());
objSDocuments.JournalEntries.DueDate = dtPostingDate;
objSDocuments.JournalEntries.ReferenceDate = dtPostingDate;
objSDocuments.JournalEntries.TaxDate = dtPostingDate;
objSDocuments.JournalEntries.UseAutoStorno = BoYesNoEnum.tYES;
objSDocuments.JournalEntries.StornoDate = dtPostingDate.AddDays(1);
foreach (JHeaderLines objHeader in lstHeaderLines)
{
objSDocuments.JournalEntries.Lines.AccountCode = objHeader.AccountCode;
objSDocuments.JournalEntries.Lines.Debit = (Double)objHeader.Debit;
objSDocuments.JournalEntries.Lines.Credit = (Double)objHeader.Credit;
if (objHeader.PrimaryFormItemId > 0)
{
try
{
objSDocuments.JournalEntries.Lines.PrimaryFormItems.CashFlowLineItemID = objHeader.PrimaryFormItemId;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}

objSDocuments.JournalEntries.Lines.Add();
}


string iDraftOrder = "";
int iError = objSDocuments.Add();

Some more details about the error : Please find the application / windows logs -

rahuljain257
Participant
0 Kudos

can anyone please look into this issue !!!

Accepted Solutions (0)

Answers (2)

Answers (2)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi Rahul,

One important thing, is it getting crashed every time or randomly it is crashing? Also is it specific to one particular environment or it is crashing everywhere.

There can be the issues while there is DI API version mismatch on client machines. For this, you can refer to SAP Note 861599.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

rahuljain257
Participant
0 Kudos

Thanks Ankit for your reply.

We have installed on SAP Hana on the server & I am doing the development on it during the debugging or execution of the app I am stumbling upon this error. One more thing when I set the value to primary form item @ that time, the error pops out.

  1. Crashed Everytime : Yes
  2. No Version Mis-Match : Cause I am doing the development on the server only so no issue related to this.
  3. DI API version mismatch on client machines : No, We have installed SAP Hana on Fresh Server so no issue related to version mismatch
ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

This appears to be the same issue as in SAP Note 2615423.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support