Understanding Sales Post Codeunit


I am a beginner in NAV. I am currently having a trouble understanding the Sales Post Codeunit. The Processes it follows and the way it works, is some what vague for me.

If someone can give me a way to understand the processes and mechanism underneath, then it would be very helpful.


That is rather a vague question, in a very large area. Essentially my understanding is the codeunit does all the appropriate shipping and invoicing of the sales orders, populating all appropriate tables, serial/lot, value entry, invoicing, dimensions, etc etc, based upon the statuses of each line and where the call to action is made from - sales order, inventory pick etc. It simply moves the stock, creates all the associated entries and moves onto the next stage.

I would recommend if you have particular questions on that codeunit (one of the more complex ones I understand) then you post them in the developers forum - in case you have not guessed, I am obviously not one from the above description [:D]


Thank you for enlightening me a bit. I accept my question was vague. My actual problem was difficulty in understanding the flowchart that the Sales Post follows. Example - The Res. Jnl. - PostLine Codeunit follows like this -

Set the Dimensions, With Resource Journal Line, it generates next entry, checks the entries by a call to checkLine, then locks Resource Register, updates it, then it populates Resource Ledger Entries (Checks them where necessary), then inserts the entry, lastly copies Journal Line Dim values to the Ledger entry.

This is a quite simple process. As a beginner, I didn’t find difficulty following the codes to generate a flowchart out of it. A flowchart obviously helps in creation of the codes with very less pain because the process is already given, just the implementation is needed.

The same is difficult for me in case of Sales Post as it is a huge and multi functional codeunit. If you could provide me a simpler flow through the codeunit (as I examplified), then it would be very very helpful.

Thanks again for giving me an Idea of the Codeunit.


I have moved this to the developers forum in the hope someone has a flowchart for the sales post codeunit, or can explain it [:D] in this format to the user if they have a spare day or two.

Thanks very much. Hope some one can help me with this.

Hi, in my courses in Italy I explain the behaviour of codeunit 80 and 90. It’s difficult (and very long) to explain here, you must first of all understand the principle of “single-table posting function” (journals, ledgers and journal posting), then you understand also the “multiple-table posting function” on which are based those codeunits…


Thank you very much Marco for giving me a way.

Did you mean the Postings that are divided in Line & Batches? I am currently trying to understand the simple posting routines Like Journal PostLines & PostBatches.

But for multiple table routines, I am ,kind of, getting confused in following. Can you please give me a summery of just “What Tables are REALLY involved in this Posting routine (80 for ex:)?”

Then I can try to follow the way they are accessed for updation atleast.

Thanks again.

If you don’t know how the journals work, how can you understand the codeunit 80? The problem is that codeunit 80 and 90 use the journals they need in a specific posting. For example if you post an order in which you have one or more lines with item, then the codeunit 80 uses the Item Journal to post the shipment of the item itself. If you have one or more lines with resources, it uses the Resource Journal to post them, ad so on. The problem is first of all understand how those journals work. The most difficult part of the codeunit is the General Journal posting, because there’s not an immediate connection between the number of lines on the order, and the number of entries on the General Ledger.

Hope this can help you


Thank you very much marco. It helped me a lot. I needed to know atleast the way to approach. Now it is clearer. I can work it out from here myself. But still if I find any problem, I will let you know.

Thanks to all for the responses.