Inserting records in Gen. Journal Line

Hi everyone,

I want to insert lines in table 81 (Gen. Journal Line).
I can’t understand how the values of Journal Template Name, Line No. and Document No. are generated.
I looked into codeunit 80 and 90, but couldn’t figure it out…

Can anyone help me understand it?

I am not inserting my records directly with page 39(General Journal) but trough code in another page…

If Template & Batch name would be unique then you can hardcode them in you code else you need to filter them out & insert them.

If you have your batch name, then you can find the template name from Table Gen. Journal Batch by filtering.

For document No. : Refer to the SetUpNewLine function in Gen. Journal Line Table.

On Gen Journal Bathes You will find Journal Template Name and as well as here you can No series for generating document no automatically for given batch.

Line No is auto generated by system.