The posting process

The posting process is the most important process in Dynamics NAV. It commits the data entered by the users into the financial ledgers. There are a few different posting processes; however, they all follow the same structure. The posting process runs through a lot of code from a lot of functions. In fact, many functions are executed many times. This section does not cover the posting process in depth, instead, it shows the overview of the codeunits and how they are structured.

There are several posting routines, one for each journal table and one for each group of documents. All posting routines use more than one codeunit. In Dynamics NAV, you can find more than 80 codeunits with the word post in their description. That's quite a few!

Let's see a couple of examples of the posting's codeunits structure. The first example is posting codeunits for sales documents. In the second example, we will see posting's codeunits for General Journal lines.

The codeunit structure for sales posting

The sales posting routine starts with four codeunits. The following diagram shows the schema that shows how each codeunit relates to one another:

The codeunit structure for sales posting

A user can start the posting process by selecting the Post or the Post & Print action, which will run Codeunit 81 Sales-Post (Yes/No) or Codeunit 82 Sales-Post + Print respectively. Both codeunits perform the same action; the only difference is that the Codeunit 82 Sales-Post + Print prints the posted sales document at the end.

Both codeunits ask a confirmation from the user and check whether the post with the job queue is activated. If the post with the job queue is activated, they call the Codeunit 88 Sales Post via Job Queue, which is an automatic process to post documents when the system is not busy.

When the record in the queue is processed, Codeunit 80 Sales-Post is called in order to end the posting routine. If the post with the job queue is not activated, Codeunit 80 Sales-Post is called from Codeunit 81 or Codeunit 82.

Codeunit 80 Sales-Post is the most important one. It checks the data, inserts records into the historical document tables, and creates all the required journal lines. It also calls the posting routines for the journal lines. You will find similar structures in the other document-posting routines.

The codeunit structure for General Journal posting

The General Journal routine consists of seven codeunits. The following screenshot shows us the schema of how each codeunit relates to each other:

The codeunit structure for General Journal posting

The general journal posting routine can start from several places. Either from a general journal page or a general journal batch page. When the user clicks on Post or Post & Print, this will run one of the following codeunits: Codeunit 231 Gen. Jnl.-Post, codeunit 232 Gen. Jnl.-Post + Print, codeunit 233 Gen. Jnl.-B.Post, or codeunit 234 Gen. Jnl.-B.Post + Print.

All these codeunits ask for confirmation from the user, and codeunits 232 and 234 also print the posted entries at the end. After that, they all call codeunit 13 Gen. Jnl.-Post Batch. This codeunit checks the consistency of all the lines individually, by calling Codeunit 11 Gen. Jnl.-Check Line. Codeunit 13 also checks that all the lines in the transactions are balanced, and if so, it inserts some secondary data into the records.

Finally, codeunit 13 calls codeunit 12 Gen. Jnl.-Post Line for each line. Codeunit 12 is the one in charge of creating the corresponding ledger entries. If some other posting routines need to post General Journal Lines, they do so by calling Codeunit 12 directly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.136.235