Table "Gen. Journal Batch"
Stores journal batch configurations that group journal lines for processing and provide default settings. Batches inherit behavior from journal templates and enable organized transaction entry with shared defaults.
Remarks
Primary container for journal lines with batch-level validation and processing controls. Key relationships: Links to Gen. Journal Template for configuration and Gen. Journal Line for transactions. Extensibility: Supports approval workflows and batch-level customization through events and configuration fields.
Properties
| Name | Value |
|---|---|
| Caption | Gen. Journal Batch |
| DataCaptionFields | 2,3 |
| LookupPageID | Page Microsoft.Finance.GeneralLedger.Journal."General Journal Batches" |
| DataClassification | CustomerContent |
Fields
| Name | Type | Description |
|---|---|---|
| "Journal Template Name" | Code[10] | References the journal template that defines behavior and configuration for this batch. |
| Name | Code[10] | Unique identifier for the journal batch within the template scope. |
| Description | Text[100] | Descriptive name for the journal batch providing user-friendly identification. |
| "Reason Code" | Code[10] | Reason code applied to all journal lines in this batch for audit and reporting purposes. |
| "Bal. Account Type" | Enum Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Account Type" | Default balancing account type applied to journal lines in this batch when no specific balancing account is specified. |
| "Bal. Account No." | Code[20] | Default balancing account number applied to journal lines when no specific balancing account is specified. |
| "No. Series" | Code[20] | Number series used for automatic document number assignment in journal lines within this batch. |
| "Posting No. Series" | Code[20] | Number series used for automatic posting document number assignment when journal lines are posted. |
| "Copy VAT Setup to Jnl. Lines" | Boolean | Controls automatic copying of VAT posting group setup from accounts to journal lines for VAT compliance. |
| "Allow VAT Difference" | Boolean | Enables VAT difference handling and manual VAT adjustments for journal lines in this batch. |
| "Allow Payment Export" | Boolean | Controls whether journal lines in this batch can be exported for electronic payment processing. |
| "Bank Statement Import Format" | Code[20] | Specifies the import format used for processing bank statements related to this journal batch. |
| "Template Type" | Enum Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Template Type" | Journal template type inherited from the associated journal template for workflow and validation control. |
| Recurring | Boolean | Indicates whether this journal batch supports recurring journal entries with automatic regeneration capabilities. |
| "Suggest Balancing Amount" | Boolean | Controls whether the system automatically suggests balancing amounts when creating journal lines in this batch. |
| "Pending Approval" | Boolean | Indicates whether this journal batch is currently pending approval in the approval workflow system. |
| "Copy to Posted Jnl. Lines" | Boolean | Controls whether posted journal entries are automatically copied to posted journal lines for archival and audit purposes. |
| "No. of Lines" | Integer | Specifies the number of lines in this journal batch. |
| "Last Modified DateTime" | DateTime | System-maintained timestamp indicating when this journal batch was last modified for change tracking. |
| BalAccountId | Guid | System identifier linking this batch to the associated G/L Account for API integration and balancing account resolution. |
| SystemId | Guid | |
| SystemCreatedAt | DateTime | |
| SystemCreatedBy | Guid | |
| SystemModifiedAt | DateTime | |
| SystemModifiedBy | Guid | |
| SystemCreatedByUserName | Text[50] | |
| SystemCreatedByFullName | Text[80] | |
| SystemModifiedByUserName | Text[50] | |
| SystemModifiedByFullName | Text[80] | |
| SystemRowVersion | BigInteger |
Methods
SetupNewBatch
Sets up a new journal batch with default values from the journal template. Copies configuration settings like balancing account, number series, and reason codes from the template.
procedure SetupNewBatch()
LinesExist
Checks whether any journal lines exist for this journal batch. Used for validation before allowing batch deletion or modification.
procedure LinesExist(): Boolean
Returns
| Type | Description |
|---|---|
| Boolean |
True if journal lines exist for this batch, false otherwise. |
GetBalance
Calculates the total balance of all journal lines in this batch. Returns the sum of Balance (LCY) field for all lines in the batch.
procedure GetBalance(): Decimal
Returns
| Type | Description |
|---|---|
| Decimal |
The total balance of all journal lines in local currency. |
CheckBalance
Checks the balance of the journal batch and triggers appropriate events. Calls OnGeneralJournalBatchBalanced if balanced, OnGeneralJournalBatchNotBalanced if not.
procedure CheckBalance(): Decimal
Returns
| Type | Description |
|---|---|
| Decimal |
The current balance of the journal batch in local currency. |
UpdateBalAccountId
Updates the Bal. Account Id field based on the current balancing account number and type. Synchronizes the system ID field with the referenced G/L Account record.
procedure UpdateBalAccountId()
Events
OnGeneralJournalBatchBalanced
Integration event that occurs when a general journal batch is balanced (total balance equals zero). Allows customization of behavior when journal batches achieve balance validation.
[IntegrationEvent(True,False)]
local procedure OnGeneralJournalBatchBalanced()
OnGeneralJournalBatchNotBalanced
Integration event that occurs when a general journal batch is not balanced (total balance is not zero). Allows customization of error handling or warnings when journal batches fail balance validation.
[IntegrationEvent(True,False)]
local procedure OnGeneralJournalBatchNotBalanced()
OnAfterSetupNewBatch
Integration event raised after setting up a new journal batch with default configuration. Enables custom initialization of batch settings and default values.
[IntegrationEvent(False,False)]
local procedure OnAfterSetupNewBatch(var GenJnlBatch: Record "Gen. Journal Batch")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlBatch | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Batch" |
Newly created journal batch for customization |
OnBeforeCheckJnlIsNotRecurring
Integration event raised before checking if journal batch is not recurring type. Enables custom validation logic for recurring journal restrictions.
[IntegrationEvent(False,False)]
local procedure OnBeforeCheckJnlIsNotRecurring(var GenJournalBatch: Record "Gen. Journal Batch"; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalBatch | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Batch" |
Journal batch to validate for recurring type |
| IsHandled | Boolean |
Set to true to skip standard recurring journal validation |
OnBeforeModifyLines
Integration event raised before modifying journal lines when batch settings change. Enables custom handling of line updates during batch modification.
[IntegrationEvent(False,False)]
local procedure OnBeforeModifyLines(var GenJournalBatch: Record "Gen. Journal Batch"; i: Integer; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalBatch | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Batch" |
Journal batch being modified |
| i | Integer |
Iterator value during batch processing |
| IsHandled | Boolean |
Set to true to skip standard line modification logic |
OnBeforeNoSeriesValidate
Integration event raised before validating number series assignment on journal batch. Enables custom number series validation logic and assignment rules.
[IntegrationEvent(False,False)]
local procedure OnBeforeNoSeriesValidate(var GenJournalBatch: Record "Gen. Journal Batch"; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalBatch | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Batch" |
Journal batch with number series to validate |
| IsHandled | Boolean |
Set to true to skip standard number series validation |
OnBeforeSetupNewBatch
Integration event raised before setting up a new journal batch configuration. Enables custom batch creation logic and default value assignment.
[IntegrationEvent(False,False)]
local procedure OnBeforeSetupNewBatch(GenJournalBatch: Record "Gen. Journal Batch"; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalBatch | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Batch" |
Journal batch being set up |
| IsHandled | Boolean |
Set to true to skip standard batch setup logic |
OnGetBalanceOnAfterSetGenJournalLineFilters
Integration event raised after setting filters on journal lines during balance calculation. Enables additional filtering criteria for balance computation.
[IntegrationEvent(False,False)]
local procedure OnGetBalanceOnAfterSetGenJournalLineFilters(var GenJournalLine: Record "Gen. Journal Line")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
Journal line record with applied filters for balance calculation |