Codeunit 230 "GenJnlManagement"
Base Application · Microsoft.Finance.GeneralLedger.Journal
Across versions
- BC23-28present
- BC292 procedures added
- BC30unchanged
Neighbourhood 25 connected objects and pages
Base Application · Microsoft.Finance.GeneralLedger.Journal · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| Permissions | TableData “Gen. Journal Template” = rimd, TableData “Gen. Journal Batch” = rimd |
Events published
OnAfterGetAccounts(var GenJournalLine: Record "Gen. Journal Line"; var AccName: Text[100]; var BalAccName: Text[100])(integration): Integration event raised after retrieving account names for journal line display. Enables customization of account name lookup and display logic.OnAfterCheckName(GenJnlBatch: Record "Gen. Journal Batch"; CurrentJnlBatchName: Code[10]; var GenJournalLine: Record "Gen. Journal Line")(integration): Integration event raised after validating journal batch name exists and is properly configured. Enables custom batch validation logic and post-validation processing.OnAfterSetName(var GenJournalLine: Record "Gen. Journal Line"; CurrentJnlBatchName: Code[10])(integration): Integration event raised after setting journal batch filter on journal lines. Enables custom filtering logic and post-filter processing.OnAfterOpenJournalBatch(GenJnlBatch: Record "Gen. Journal Batch"; GenJnlTemplate: Record "Gen. Journal Template")(integration): Integration event raised after opening journal batch operations complete. Enables custom logic after batch and template have been selected and configured.OnAfterTemplateSelection(var GenJnlTemplate: Record "Gen. Journal Template"; var GenJnlLine: Record "Gen. Journal Line"; var JnlSelected: Boolean; var OpenFromBatch: Boolean; RecurringJnl: Boolean)(integration): Integration event raised after template selection process completes. Enables custom logic after template selection and journal page launch.OnBeforeLookupName(var GenJnlBatch: Record "Gen. Journal Batch"; var GenJnlLine: Record "Gen. Journal Line")(integration): Integration event raised before journal batch name lookup operations. Enables custom filtering or validation logic before batch selection.OnBeforeGetJournalSimplePageModePreference(PageIdToCheck: Integer)(integration): Integration event raised before retrieving journal simple page mode preference. Enables custom logic before preference retrieval.OnBeforeSetJournalSimplePageModePreference(var SetToSimpleMode: Boolean; PageIdToSet: Integer; var IsHandled: Boolean)(integration): Integration event raised before setting journal simple page mode preference. Enables custom validation or modification of preference settings.OnBeforeOpenJnl(var CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line")(integration): Integration event raised before opening journal with batch name operations. Enables custom validation or preprocessing before journal opening.OnBeforeOpenJnlBatch(var GenJnlBatch: Record "Gen. Journal Batch"; var IsHandled: Boolean)(integration): Integration event raised before journal batch opening operations. Enables custom logic to completely override batch opening process.OnBeforeOpenJournalPageFromBatch(var GenJnlBatch: Record "Gen. Journal Batch"; var GenJnlTemplate: Record "Gen. Journal Template"; var IsHandled: Boolean)(integration): Integration event raised before opening journal page from batch context. Enables custom logic to override page opening from batch selection.- subscribers: Codeunit 1695 “Bank Deposit Subscribers” OnBeforeOpenJournalPageFromBatch
OnBeforeRunTemplateJournalPage(var GenJnlTemplate: Record "Gen. Journal Template"; var GenJnlLine: Record "Gen. Journal Line"; OpenFromBatch: Boolean; var IsHandled: Boolean)(integration): Integration event raised before running template journal page operations. Enables custom logic to override journal page launching.OnTemplateSelectionSetFilter(var GenJnlTemplate: Record "Gen. Journal Template"; var PageTemplate: Option; var RecurringJnl: Boolean; PageId: Integer; var GenJnlLine: Record "Gen. Journal Line")(integration): Integration event raised during template selection to enable custom filtering logic. Allows modification of template filters and selection criteria.OnFindTemplateFromSelectionOnBeforeGenJnlTemplateInsert(var GenJnlTemplate: Record "Gen. Journal Template")(integration): Integration event raised before inserting a new journal template during template selection. Enables custom template configuration before insertion.OnOpenJnlOnAfterCheckTemplateName(var GenJournalLine: Record "Gen. Journal Line"; var CurrentJnlBatchName: Code[10])(integration): Integration event raised after template name checking during journal opening. Enables custom processing after template validation.OnOpenJnlBatchOnBeforeCheckGenJnlTemplateCount(var GenJnlBatch: Record "Gen. Journal Batch"; var GenJnlTemplate: Record "Gen. Journal Template")(integration): Integration event raised before checking journal template count during batch operations. Enables custom template filtering or validation logic.OnAfterCalcBalance(var GenJournalLine: Record "Gen. Journal Line")(integration): Integration event raised after balance calculation operations complete. Enables custom processing or validation after balance calculations.OnCalcBalanceOnAfterCopyFilters(var TempGenJournalLine: Record "Gen. Journal Line" temporary)(integration): Integration event raised after copying filters during balance calculation setup. Enables custom filter modification before balance calculation processing.OnCalcBalanceOnBeforeTempGenJnlLineNext(var TempGenJournalLine: Record "Gen. Journal Line")(integration): Integration event raised before moving to next record during balance calculation. Enables custom record positioning logic during balance calculation.
Procedures
TemplateSelection(PageID: Integer; PageTemplate: Enum "Gen. Journal Template Type"; RecurringJnl: Boolean; var GenJnlLine: Record "Gen. Journal Line"; var JnlSelected: Boolean): Manages template selection for journal pages based on page type and recurring journal requirements. Filters available templates and launches appropriate journal interface.TemplateSelectionFromBatch(var GenJnlBatch: Record "Gen. Journal Batch"): Opens journal interface directly from a batch selection, bypassing template selection. Validates batch configuration and launches the appropriate journal page.OpenJnl(var CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line"): Opens journal batch with current batch name and manages batch selection logic. Handles batch validation and provides default batch creation when necessary.OpenJnlBatch(var GenJnlBatch: Record "Gen. Journal Batch"): Opens and initializes a general journal batch with template selection and validation. Ensures proper batch setup by creating missing templates and handling batch selection logic.IsBatchNoSeriesEmpty(var CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line"): Boolean: Checks if the journal batch has an empty number series configuration. Validates whether the batch requires manual document numbering or has automatic numbering configured.CheckTemplateName(CurrentJnlTemplateName: Code[10]; var CurrentJnlBatchName: Code[10])CheckName(CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line"): Validates journal batch exists and gets batch configuration for the specified batch name. Ensures batch is properly configured before allowing journal operations.CheckCurrencyCode(CurrencyCode: Code[10]): Validates currency code exists in the currency master data. Provides currency validation for journal line processing.SetName(CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line"): Sets journal batch filter on journal lines and positions to first record. Configures journal line record for batch-specific operations.SetJournalSimplePageModePreference(SetToSimpleMode: Boolean; PageIdToSet: Integer): Configures journal page display mode preference for the current user. Stores user preference for simple or classic view mode in journal pages.GetJournalSimplePageModePreference(PageIdToCheck: Integer): Boolean: Retrieves journal page display mode preference for the current user. Returns user preference for simple or classic view mode in journal pages.GetLastViewedJournalBatchName(PageIdToCheck: Integer): Code[10]: Retrieves the last viewed journal batch name for a specific page from user preferences. Returns stored user preference for batch selection when reopening journal pages.SetLastViewedJournalBatchName(PageIdToCheck: Integer; GenJnlBatch: Code[10]): Stores the last viewed journal batch name for a specific page in user preferences. Updates user preference for batch selection to improve user experience on page reopening.LookupName(var CurrentJnlBatchName: Code[10]; var GenJnlLine: Record "Gen. Journal Line"): Provides journal batch lookup functionality with filtering and selection capabilities. Opens batch selection page and updates current batch name based on user selection.SetJnlBatchName(var GenJnlLine: Record "Gen. Journal Line"): Opens journal batch name lookup and updates journal line batch assignment. Provides user interface for selecting and assigning journal batch to current line.GetAccounts(var GenJnlLine: Record "Gen. Journal Line"; var AccName: Text[100]; var BalAccName: Text[100]): Retrieves and caches account names for display in journal lines to improve user experience. Optimizes performance by caching account names to avoid repeated database lookups.CalcBalance(var GenJnlLine: Record "Gen. Journal Line"; LastGenJnlLine: Record "Gen. Journal Line"; var Balance: Decimal; var TotalBalance: Decimal; var ShowBalance: Boolean; var ShowTotalBalance: Boolean): Calculates running balance and total balance for journal lines within the current batch context. Provides balance calculations for journal line display and validation purposes.CalcBatchTotal(var GenJnlLine: Record "Gen. Journal Line"; var BatchTotal: Decimal; var ShowBatchTotal: Boolean)+ BC29GetAvailableGeneralJournalTemplateName(TemplateName: Code[10]): Code[10]: Generates unique journal template names by checking for conflicts and incrementing names when needed. Ensures new template names are unique while maintaining meaningful naming based on template type.TemplateSelectionSimple(var GenJnlTemplate: Record "Gen. Journal Template"; TemplateType: Enum "Gen. Journal Template Type"; RecurringJnl: Boolean): BooleanShowNotificationIfSpendRequestIsRequired(GLAccountNo: Code[20]; SpendRequestNo: Code[20]; var NotificationID: Guid)+ BC29 (internal): Used from journal pages and warns users of need to specify spend request no.
Plus 5 local procedures.
Triggers
OnRun
Called by
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Page 39 “General Journal” (11 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnAfterGetRecord → GetAccounts, …) - Page 254 “Purchase Journal” (9 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnAfterGetRecord → GetAccounts, …) - Page 253 “Sales Journal” (8 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnAfterGetRecord → GetAccounts, …) - Page 256 “Payment Journal” (7 calls:
CurrentJnlBatchNameOnAfterValidate → SetName,OnAfterGetCurrRecord → GetAccounts,OnAfterGetRecord → GetAccounts, …) - Page 255 “Cash Receipt Journal” (6 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnAfterGetRecord → GetAccounts, …) - Page 1020 “Job G/L Journal” (5 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnOpenPage → OpenJnl, …) - Page 283 “Recurring General Journal” (5 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnOpenPage → OpenJnl, …) - Page 5628 “Fixed Asset G/L Journal” (5 calls:
CurrentJnlBatchNameOnAfterValidate → SetName,OnAfterGetCurrRecord → GetAccounts,OnOpenPage → OpenJnl, …) - Page 610 “IC General Journal” (5 calls:
CurrentJnlBatchNameOnAfterVali → SetName,OnAfterGetCurrRecord → GetAccounts,OnOpenPage → OpenJnl, …) - Page 1190 “Create Payment” (2 calls:
BatchSelection → CheckTemplateName,OnOpenPage → TemplateSelectionSimple) - Page 1690 “Bank Deposit” (2 calls:
OnOpenPage → OpenJnl,OnOpenPage → TemplateSelection) - Table 1690 “Bank Deposit Header” (2 calls:
InitRecord → LookupName,InitRecord → SetName) - Codeunit 181 “Copy Gen. Journal Mgt.” (1 call:
ShowFinishMessage → TemplateSelectionFromBatch) - Codeunit 233 “Gen. Jnl.-B.Post” (1 call:
Code → GetJournalSimplePageModePreference) - Codeunit 234 “Gen. Jnl.-B.Post+Print” (1 call:
Code → GetJournalSimplePageModePreference) - Codeunit 5469 “Library API - General Journal” (1 call:
SetUpNewLine → CalcBalance) - Page 251 “General Journal Batches” (1 call:
OnOpenPage → OpenJnlBatch) - Page 9120 “Journal Line Details FactBox” (1 call:
OnAfterGetCurrRecord → GetAccounts) - Report 1497 “Trans. Bank Rec. to Gen. Jnl.” (1 call:
OnPostReport → TemplateSelectionFromBatch) - Report 597 “G/L Currency Revaluation” (1 call:
OpenGeneralJournalBatch → TemplateSelectionFromBatch) - Report 8610 “Create G/L Acc. Journal Lines” (1 call:
CopyGenJnlFromStdJnl → CalcBalance) - Report 8611 “Create Customer Journal Lines” (1 call:
CopyGenJnlFromStdJnl → CalcBalance) - Report 8612 “Create Vendor Journal Lines” (1 call:
CopyGenJnlFromStdJnl → CalcBalance) - Table 750 “Standard General Journal” (1 call:
CopyGenJnlFromStdJnl → CalcBalance)
Recent changes
- 2026-09-02 #10538 [Master]-Slice 425446: Payment Journal Batch Total (main, BC30, feature)
- 2026-07-31 #8959 Deliverable 638799: Spend Requests in Base App (main, BC30, feature)
Countries that replace it
Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "GenJnlManagement"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.