---
title: "Codeunit 131306 Library - Journals, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/131306-library-journals/points/
object: https://jonas-paprotka.de/ref/codeunit/131306-library-journals/
app: "Application Test Library"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 131306 Library - Journals, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/131306-library-journals/points/

11 procedures and triggers with a step in src/Layers/W1/Tests/ApplicationTestLibrary/LibraryJournals.Codeunit.al, in source order, read from the text, not from a run.

## CreateGenJournalLine

[Line 15](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L15).

- [27](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L27) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Journal Template Name`
- [28](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L28) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Journal Batch Name`
- [30](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L30) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Line No.`
- [30](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L30) calls [Codeunit 131000 Library - Utility](https://jonas-paprotka.de/ref/codeunit/131000-library-utility/) `GetNewLineNo`
- [31](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L31) writes [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) Insert(true)
- [32](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L32) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Posting Date`
- [33](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L33) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `VAT Reporting Date`
- [34](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L34) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Document Type`
- [35](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L35) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Account Type`
- [36](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L36) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Account No.`
- [37](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L37) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Amount`
- [39](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L39) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Document No.`
- [39](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L39) calls [Codeunit 310 No. Series](https://jonas-paprotka.de/ref/codeunit/310-no-series/) `PeekNextNo`
- [41](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L41) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Document No.`
- [42](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L42) calls [Codeunit 131000 Library - Utility](https://jonas-paprotka.de/ref/codeunit/131000-library-utility/) `GenerateRandomCode`
- [43](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L43) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `External Document No.`
- [44](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L44) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Source Code`
- [44](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L44) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `FindGeneralJournalSourceCode`
- [45](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L45) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Bal. Account Type`
- [46](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L46) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Bal. Account No.`
- [47](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L47) raises `OnBeforeModifyGenJnlLineWhenCreate`
- [48](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L48) writes [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) Modify(true)

## CreateGenJournalLine2

[Line 51](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L51).

- [67](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L67) calls `GetLastGenJnlLineAndBalance`
- [68](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L68) calls `SetLastGenJnlLineFields`
- [71](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L71) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Journal Template Name`
- [72](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L72) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Journal Batch Name`
- [74](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L74) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Line No.`
- [74](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L74) calls [Codeunit 131000 Library - Utility](https://jonas-paprotka.de/ref/codeunit/131000-library-utility/) `GetNewLineNo`
- [75](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L75) writes [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) Insert(true)
- [78](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L78) calls [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `SetUpNewLine`
- [81](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L81) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Document Type`
- [82](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L82) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Account Type`
- [83](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L83) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Account No.`
- [84](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L84) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Amount`
- [85](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L85) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `External Document No.`
- [86](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L86) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Source Code`
- [86](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L86) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `FindGeneralJournalSourceCode`
- [87](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L87) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Bal. Account Type`
- [88](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L88) validates [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) `Bal. Account No.`
- [89](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L89) raises `OnBeforeModifyGenJnlLineWhenCreate`
- [90](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L90) writes [Table 81 Gen. Journal Line](https://jonas-paprotka.de/ref/table/81-gen-journal-line/) Modify(true)

## CreateGenJournalLineWithBatch

[Line 93](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L93).

- [98](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L98) calls `CreateGenJournalBatch`
- [99](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L99) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGLAccount`
- [100](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L100) calls `CreateGenJournalLine`

## CreateGenJournalBatch

[Line 112](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L112).

- [116](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L116) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGenJournalTemplate`
- [117](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L117) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGenJournalBatch`

## CreateGenJournalBatchWithType

[Line 120](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L120).

- [124](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L124) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGenJournalTemplate`
- [125](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L125) validates [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) `Type`
- [126](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L126) writes [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) Modify(true)
- [127](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L127) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGenJournalBatch`

## SelectGenJournalBatch

[Line 130](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L130).

- [137](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L137) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGLAccount`
- [141](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L141) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateGenJournalBatch`
- [142](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L142) validates [Table 232 Gen. Journal Batch](https://jonas-paprotka.de/ref/table/232-gen-journal-batch/) `No. Series`
- [142](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L142) calls [Codeunit 131300 Library - ERM](https://jonas-paprotka.de/ref/codeunit/131300-library-erm/) `CreateNoSeriesCode`
- [143](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L143) validates [Table 232 Gen. Journal Batch](https://jonas-paprotka.de/ref/table/232-gen-journal-batch/) `Bal. Account Type`
- [146](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L146) validates [Table 232 Gen. Journal Batch](https://jonas-paprotka.de/ref/table/232-gen-journal-batch/) `Bal. Account No.`
- [147](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L147) writes [Table 232 Gen. Journal Batch](https://jonas-paprotka.de/ref/table/232-gen-journal-batch/) Modify(true)

## SelectGenJournalTemplate

[Line 150](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L150).

- [160](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L160) validates [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) `Name`
- [161](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L161) calls [Codeunit 131000 Library - Utility](https://jonas-paprotka.de/ref/codeunit/131000-library-utility/) `GenerateRandomCode`
- [162](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L162) validates [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) `Type`
- [163](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L163) validates [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) `Page ID`
- [164](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L164) validates [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) `Recurring`
- [165](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L165) writes [Table 80 Gen. Journal Template](https://jonas-paprotka.de/ref/table/80-gen-journal-template/) Insert(true)

## GetLastGenJnlLineAndBalance

[Line 171](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L171), local.

- [181](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L181) calls [Codeunit 230 GenJnlManagement](https://jonas-paprotka.de/ref/codeunit/230-genjnlmanagement/) `CalcBalance`

## SetLastGenJnlLineFields

[Line 185](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L185), local.

- [190](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L190) calls [Codeunit 310 No. Series](https://jonas-paprotka.de/ref/codeunit/310-no-series/) `PeekNextNo`
- [193](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L193) calls [Codeunit 131000 Library - Utility](https://jonas-paprotka.de/ref/codeunit/131000-library-utility/) `GenerateRandomCode`

## SetPostWithJobQueue

[Line 198](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L198).

- [203](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L203) validates [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) `Post with Job Queue`
- [204](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L204) writes [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) Modify(true)

## SetPostAndPrintWithJobQueue

[Line 207](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L207).

- [212](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L212) validates [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) `Post & Print with Job Queue`
- [213](https://jonas-paprotka.de/ref/codeunit/131306-library-journals/source/#L213) writes [Table 98 General Ledger Setup](https://jonas-paprotka.de/ref/table/98-general-ledger-setup/) Modify(true)

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
