cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting Journal Voucher Entry through DIAPI

vigna
Member
0 Kudos

When i tried to insert as Journal Voucher Entry, it gets successfully inserted. But, when i want to add the Primary Form Items, my diapi crashes and program is been stopped. The error i am facing on this line journalVoucher.JournalEntries.Lines.PrimaryFormItems.CashFlowLineItemID. Even when i try to debug journalVoucher.JournalEntries.Lines.PrimaryFormItems this property itself got error. kindly help me.

There is already an thread unresolved Thread

      //credit <br>                var recordset = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);<br>                strSql = "select AcctCode from OACT where FormatCode= '" + journal.glCreditCode + "'";<br>                recordset.DoQuery(strSql);<br>                string account_code = Convert.ToString(recordset.Fields.Item("AcctCode").Value);<br>                journalVoucher.JournalEntries.Lines.AccountCode = account_code;<br>                if (!string.IsNullOrEmpty(journal.glStaffLoanCode))<br>                {<br>                    journalVoucher.JournalEntries.Lines.Credit = journal.credit - journal.loanAmount;<br>                }<br>                else<br>                {<br>                    journalVoucher.JournalEntries.Lines.Credit = journal.credit;<br>                }<br>                journalVoucher.JournalEntries.Lines.Debit = 0;<br>                journalVoucher.JournalEntries.Lines.PrimaryFormItems.CashFlowLineItemID = 17;<br>                journalVoucher.JournalEntries.Lines.Add();

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi vigna,

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

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support