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:
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...