Processing a project journal
As with most of the modules in Dynamics AX, the Project management and accounting module contains serveral journals, such as Hour, Expense, Fee, or Item journals. Although they are similar to the General journal, they provide a more convenient user interface for working with projects, and contain some module-specific features.
In this recipe, we will create and post a project journal from code. We will process an Hour journal, holding a registered employee's time.
How to do it...
1. In the AOT, create a new job named
ProjJournalCreate
with the following code:static void ProjJournalCreate(Args _args) { ProjJournalTable jourTable; ProjJournalTrans jourTrans; ProjJournalTableData jourTableData; ProjJournalTransData jourTransData; ProjJournalStatic jourStatic; ttsBegin; jourTableData = JournalTableData::newTable(jourTable); jourTable.JournalId = jourTableData.nextJournalId(); jourTable.JournalType = ProjJournalType::Hour; jourTable.JournalNameId = 'Hours'; jourTableData...