The Project module in Dynamics AX is tightly integrated with the General ledger. It also contains four journals—Hour, Expense, Item, and Fee, which are used in a similar way to other journals. For example, the Expense journal is actually based on the same data sources as the General journal.
In this recipe, we will create a journal from X++ code in the Project module. We will create the Hour journal, which is very specific to the Project module.
In AOT, create a new class called ProjJournalCreate with the following code:
class ProjJournalCreate { } void create() { ProjJournalTable jourTable; ProjJournalTrans jourTrans; ProjJournalTableData jourTableData; ProjJournalTransData jourTransData; ProjJournalStatic jourStatic; ; jourTableData = JournalTableData::newTable(jourTable); jourTable.JournalId = jourTableData.nextJournalId(); jourTable.JournalType = ProjJournalType::Hour...