How to do it...

Carry out the following steps in order to complete this recipe:

  1. Create a new Dynamics 365 solution named CreateGeneralJournal. Change the model name in properties with the one created earlier.
  2. In the project, create a new class named LedgerJournalTransData with the following code snippet:
 public class LedgerJournalTransData extends JournalTransData { } public void create( boolean _doInsert = false, boolean _initVoucherList = true) { lastLineNum++; journalTrans.LineNum = lastLineNum; if (journalTableData.journalVoucherNum()) { this.initVoucher( lastVoucher, false, _initVoucherList); } this.addTotal(false, false); if (_doInsert) { journalTrans.doInsert(); } else { journalTrans.insert(); } if (journalTableData.journalVoucherNum()) ...

Get Dynamics 365 for Finance and Operations Development Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.