Table "Gen. Jnl. Allocation"
Table for storing allocation lines that distribute general journal line amounts across multiple G/L accounts. Enables splitting journal line amounts using percentages, amounts, or quantities for cost allocation and distribution.
Remarks
Core allocation functionality for general journal lines enabling multi-account distribution. Supports percentage-based, amount-based, and quantity-based allocation methods. Key fields: Account No., Allocation %, Amount, VAT handling for proper tax distribution. Integration: Links to parent journal line via template, batch, and line number references.
Properties
| Name | Value |
|---|---|
| Caption | Gen. Jnl. Allocation |
| Permissions | tabledata "Gen. Jnl. Allocation" = R |
| DataClassification | CustomerContent |
Fields
| Name | Type | Description |
|---|---|---|
| "Journal Template Name" | Code[10] | Journal template name that defines the type and behavior of the journal containing this allocation line. |
| "Journal Batch Name" | Code[10] | Journal batch name that groups related journal lines for this allocation. |
| "Journal Line No." | Integer | Line number of the parent general journal line to which this allocation applies. |
| "Line No." | Integer | Sequential line number for this allocation entry within the parent journal line. |
| "Account No." | Code[20] | G/L account number to which the allocated amount will be posted. |
| "Shortcut Dimension 1 Code" | Code[20] | First shortcut dimension code for this allocation line, typically used for department or project classification. |
| "Shortcut Dimension 2 Code" | Code[20] | Second shortcut dimension code for this allocation line, typically used for cost center or area classification. |
| "Allocation Quantity" | Decimal | Allocation quantity used for quantity-based distribution of journal line amounts. When specified, amounts are distributed proportionally based on quantities rather than percentages. |
| "Allocation %" | Decimal | Percentage of the parent journal line amount to allocate to this account. Used for percentage-based distribution where total percentages across allocation lines should equal 100%. |
| Amount | Decimal | Fixed allocation amount to be posted to this account. Used for amount-based distribution where specific amounts are allocated rather than percentages or quantities. |
| "Gen. Posting Type" | Enum Microsoft.Foundation.Enums."General Posting Type" | General posting type that determines how this allocation line affects general ledger posting. Controls whether the allocation creates purchase, sale, or other general ledger entries. |
| "Gen. Bus. Posting Group" | Code[20] | General business posting group used for determining posting accounts and VAT treatment for this allocation line. Links to general posting setup for proper account determination during posting. |
| "Gen. Prod. Posting Group" | Code[20] | General product posting group used for determining posting accounts and VAT treatment for this allocation line. Links to general posting setup for proper account determination during posting. |
| "VAT Calculation Type" | Enum Microsoft.Foundation.Enums."Tax Calculation Type" | VAT calculation method used for this allocation line to determine VAT amount computation. |
| "VAT Amount" | Decimal | VAT amount calculated for this allocation line based on the allocation amount and VAT percentage. |
| "VAT %" | Decimal | VAT percentage rate applied to this allocation line for VAT amount calculation. |
| "Account Name" | Text[100] | Name of the G/L account specified for this allocation line, automatically populated when Account No. is selected. |
| "Tax Area Code" | Code[20] | Tax area code for sales tax calculation when tax functionality is enabled for this allocation line. |
| "Tax Liable" | Boolean | Indicates whether this allocation line is subject to sales tax liability when tax functionality is enabled. |
| "Tax Group Code" | Code[20] | Tax group code for sales tax calculation when tax functionality is enabled for this allocation line. |
| "Use Tax" | Boolean | Indicates whether this allocation line uses reverse charge VAT (use tax) when tax functionality is enabled. |
| "VAT Bus. Posting Group" | Code[20] | VAT business posting group code for VAT calculation setup applicable to this allocation line. |
| "VAT Prod. Posting Group" | Code[20] | VAT product posting group code for VAT calculation setup applicable to this allocation line. |
| "Additional-Currency Amount" | Decimal | Allocation amount expressed in the additional reporting currency when ACY functionality is enabled. |
| "Dimension Set ID" | Integer | Unique identifier for the dimension set associated with this allocation line for financial analysis and reporting. |
| 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
UpdateAllocations
Updates allocation amounts and distributions for all allocation lines associated with the specified journal line. Recalculates allocation percentages and amounts to ensure total allocation equals journal line amount.
procedure UpdateAllocations(var GenJnlLine: Record "Gen. Journal Line")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record for which allocations should be updated. |
UpdateAllocationsAddCurr
Updates allocation amounts in additional reporting currency for all allocation lines associated with the specified journal line. Converts allocation amounts to additional currency using current exchange rates.
procedure UpdateAllocationsAddCurr(var GenJnlLine: Record "Gen. Journal Line"; AddCurrAmount: Decimal)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record for which additional currency allocations should be updated. |
| AddCurrAmount | Decimal |
Total additional currency amount to distribute across allocation lines. |
CheckVAT
Validates VAT setup and calculations for this allocation line based on the associated journal line context. Ensures VAT posting groups and calculation types are compatible with journal line requirements.
procedure CheckVAT(var GenJnlLine: Record "Gen. Journal Line")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record providing VAT validation context for this allocation. |
UpdateVAT
Updates VAT amounts and percentages for this allocation line based on current VAT setup and allocation amount. Calculates VAT amount using VAT posting group configuration and allocation base amount.
procedure UpdateVAT(var GenJnlLine: Record "Gen. Journal Line")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record providing VAT calculation context for this allocation. |
GetCurrencyCode
Retrieves the currency code applicable to this allocation line based on the associated journal line. Returns the journal line's currency code or LCY if no specific currency is defined.
procedure GetCurrencyCode(): Code[10]
Returns
| Type | Description |
|---|---|
| Code[10] |
Currency code for this allocation line's amounts and VAT calculations. |
CreateDim
Creates dimension set for this allocation line from the specified default dimension sources. Builds dimension combinations for financial analysis and reporting requirements.
procedure CreateDim(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
Parameters
| Name | Type | Description |
|---|---|---|
| DefaultDimSource | List of [Dictionary of [Integer, Code[20]]] |
List of default dimension sources to use for dimension set creation. |
ValidateShortcutDimCode
Validates shortcut dimension code for the specified dimension and updates the allocation line's dimension set. Ensures dimension values are valid and updates the dimension set ID accordingly.
procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| FieldNumber | Integer |
Field number indicating which shortcut dimension is being validated. |
| ShortcutDimCode | Code[20] |
Shortcut dimension code value to validate and assign. |
LookupShortcutDimCode
Opens lookup for shortcut dimension code selection and updates the allocation line's dimension set. Provides user interface for selecting valid dimension values for the specified dimension.
procedure LookupShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| FieldNumber | Integer |
Field number indicating which shortcut dimension lookup should be opened. |
| ShortcutDimCode | Code[20] |
Current shortcut dimension code value, updated with user selection. |
ShowShortcutDimCode
Retrieves and displays shortcut dimension codes for this allocation line in the provided array. Populates shortcut dimension code array with current dimension values for display purposes.
procedure ShowShortcutDimCode(var ShortcutDimCode: array[8] of Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| ShortcutDimCode | array[8] of Code[20] |
Array to populate with current shortcut dimension codes from this allocation. |
ShowDimensions
Opens the dimensions page to display and allow editing of all dimensions for this allocation line. Provides comprehensive dimension management interface for detailed financial analysis setup.
procedure ShowDimensions()
CreateDimFromDefaultDim
Creates dimension set for this allocation line from default dimension setup for the G/L account. Automatically applies standard dimension configuration based on account and posting group defaults.
procedure CreateDimFromDefaultDim()
Events
OnAfterInitDefaultDimensionSources
Integration event raised after initializing default dimension sources for allocation line dimension creation. Enables custom modification of dimension sources before dimension set creation for allocation lines.
[IntegrationEvent(False,False)]
local procedure OnAfterInitDefaultDimensionSources(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which dimension sources are being initialized. |
| DefaultDimSource | List of [Dictionary of [Integer, Code[20]]] |
List of default dimension sources that can be modified for custom dimension logic. |
OnBeforeCreateDim
Integration event raised before creating dimension set for allocation line. Enables custom logic to completely override standard dimension creation processing for allocations.
[IntegrationEvent(False,False)]
local procedure OnBeforeCreateDim(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which dimensions are being created. |
| IsHandled | Boolean |
Set to true to skip standard dimension creation logic. |
OnAfterCreateDimProcedure
Integration event raised after completing dimension creation procedure for allocation line. Enables custom processing and validation after standard dimension set creation is completed.
[IntegrationEvent(False,False)]
local procedure OnAfterCreateDimProcedure(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; CurrFieldNo: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; xGenJnlAllocation: Record "Gen. Jnl. Allocation"; OldDimSetID: Integer)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which dimensions were created. |
| CurrFieldNo | Integer |
Field number that triggered the dimension creation process. |
| DefaultDimSource | List of [Dictionary of [Integer, Code[20]]] |
List of default dimension sources used in dimension creation. |
| xGenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
Previous version of allocation record before dimension changes. |
| OldDimSetID | Integer |
Previous dimension set ID before changes were applied. |
OnAfterShowDimensions
Integration event raised after displaying dimensions page for allocation line. Enables custom processing after user interaction with allocation line dimensions.
[IntegrationEvent(False,False)]
local procedure OnAfterShowDimensions(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; xGenJnlAllocation: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which dimensions were displayed. |
| xGenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
Previous version of allocation record before dimension display interaction. |
OnAfterValidateShortcutDimCode
Integration event raised after validating shortcut dimension code for allocation line. Enables custom processing after shortcut dimension validation and dimension set updates.
[IntegrationEvent(False,False)]
local procedure OnAfterValidateShortcutDimCode(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; var xGenJnlAllocation: Record "Gen. Jnl. Allocation"; FieldNumber: Integer; var ShortcutDimCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which shortcut dimension was validated. |
| xGenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
Previous version of allocation record before shortcut dimension validation. |
| FieldNumber | Integer |
Field number indicating which shortcut dimension was validated. |
| ShortcutDimCode | Code[20] |
Shortcut dimension code value that was validated and applied. |
OnBeforeValidateShortcutDimCode
Integration event raised before validating shortcut dimension code for allocation line. Enables custom logic to override standard shortcut dimension validation processing.
[IntegrationEvent(False,False)]
local procedure OnBeforeValidateShortcutDimCode(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; var xGenJnlAllocation: Record "Gen. Jnl. Allocation"; FieldNumber: Integer; var ShortcutDimCode: Code[20])
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which shortcut dimension is being validated. |
| xGenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
Previous version of allocation record before shortcut dimension validation. |
| FieldNumber | Integer |
Field number indicating which shortcut dimension is being validated. |
| ShortcutDimCode | Code[20] |
Shortcut dimension code value being validated (can be modified). |
OnUpdateAllocationsOnAfterGenJnlAllocModify
Integration event that occurs after modifying a general journal allocation line during update process. Allows customization of allocation line processing after standard modification logic.
[IntegrationEvent(False,False)]
local procedure OnUpdateAllocationsOnAfterGenJnlAllocModify(var GenJnlAlloc: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAlloc | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
The general journal allocation record that was modified. |
OnUpdateAllocationsOnBeforeGenJnlAllocModify
Integration event that occurs before modifying a general journal allocation line during update process. Allows customization of allocation line values before standard modification logic.
[IntegrationEvent(False,False)]
local procedure OnUpdateAllocationsOnBeforeGenJnlAllocModify(GenJournalLine: Record "Gen. Journal Line"; var GenJnlAlloc: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
The source general journal line being processed. |
| GenJnlAlloc | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
The general journal allocation record being modified. |
OnUpdateAllocationsAddCurrOnAfterGenJnlAllocModify
Integration event raised after modifying allocation line during additional currency allocation updates. Enables custom processing after allocation line changes during ACY amount distribution.
[IntegrationEvent(False,False)]
local procedure OnUpdateAllocationsAddCurrOnAfterGenJnlAllocModify(var GenJnlAlloc: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAlloc | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record that was modified during ACY update process. |
OnBeforeCheckGLAccount
Integration event raised before validating G/L account setup for allocation line. Enables custom logic to override standard G/L account validation processing for allocations.
[IntegrationEvent(False,False)]
local procedure OnBeforeCheckGLAccount(GLAccount: Record "G/L Account"; var IsHandled: Boolean; var GenJnlAllocation: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GLAccount | Table Microsoft.Finance.GeneralLedger.Account."G/L Account" |
G/L Account record being validated for allocation line usage. |
| IsHandled | Boolean |
Set to true to skip standard G/L account validation logic. |
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record providing context for G/L account validation. |
OnAfterCheckGLAccount
Integration event raised after validating G/L account setup for allocation line. Enables custom processing and validation after standard G/L account checks are completed.
[IntegrationEvent(False,False)]
local procedure OnAfterCheckGLAccount(var GLAccount: Record "G/L Account"; GenJnlAllocation: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GLAccount | Table Microsoft.Finance.GeneralLedger.Account."G/L Account" |
G/L Account record that was validated for allocation line usage. |
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record providing context for G/L account validation. |
OnBeforeUpdateVAT
Integration event raised before updating VAT amounts for allocation line. Enables custom logic to completely override standard VAT update processing for allocations.
[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateVAT(var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean; var GenJnlAllocation: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record providing VAT update context. |
| IsHandled | Boolean |
Set to true to skip standard VAT update logic. |
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which VAT is being updated. |
OnAfterUpdateVAT
Integration event raised after updating VAT amounts for allocation line. Enables custom processing after standard VAT calculation and update is completed.
[IntegrationEvent(False,False)]
local procedure OnAfterUpdateVAT(var GenJournalLine: Record "Gen. Journal Line"; GenJournalLine2: Record "Gen. Journal Line"; var GenJnlAllocation: Record "Gen. Jnl. Allocation")
Parameters
| Name | Type | Description |
|---|---|---|
| GenJournalLine | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
General journal line record that provided VAT update context. |
| GenJournalLine2 | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Journal Line" |
Additional journal line record used during VAT update process. |
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which VAT was updated. |
OnBeforeValidateAccountNo
Integration event raised before validating account number for allocation line. Enables custom logic to completely override standard account number validation processing.
[IntegrationEvent(False,False)]
local procedure OnBeforeValidateAccountNo(var GenJnlAllocation: Record "Gen. Jnl. Allocation"; xGenJnlAllocation: Record "Gen. Jnl. Allocation"; var IsHandled: Boolean)
Parameters
| Name | Type | Description |
|---|---|---|
| GenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
General journal allocation record for which account number is being validated. |
| xGenJnlAllocation | Table Microsoft.Finance.GeneralLedger.Journal."Gen. Jnl. Allocation" |
Previous version of allocation record before account number validation. |
| IsHandled | Boolean |
Set to true to skip standard account number validation logic. |