---
id: object/codeunit/225
type: object
title: Codeunit 225 "Gen. Jnl.-Apply"
summary: Codeunit 225 "Gen. Jnl.-Apply" in Base Application (Microsoft.Finance.ReceivablesPayables). 4 public procedures, 43 events. Present since at least BC23, still in BC30, changed in BC24-26.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "26"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 1929227b901731d6c7b092d583b0ef94c78acd63711a7e74d0b59892feb8af22
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/GenJnlApply.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/ReceivablesPayables/GenJnlApply.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 225
name: Gen. Jnl.-Apply
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 62
  events: 43
  subscribers: 0
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 8
  implements: 0
---

# Codeunit 225 "Gen. Jnl.-Apply"

> Codeunit 225 "Gen. Jnl.-Apply" in Base Application (Microsoft.Finance.ReceivablesPayables). 4 public procedures, 43 events. Present since at least BC23, still in BC30, changed in BC24-26.

Base Application · Microsoft.Finance.ReceivablesPayables · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/GenJnlApply.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| TableNo | Gen. Journal Line |

## Events published

- `OnAfterRun(var GenJnlLine: Record "Gen. Journal Line")` (integration): Integration event raised after the application process completes. Enables custom post-processing logic after general journal line application.
- `OnAfterCustLedgEntrySetFilters(var CustLedgerEntry: Record "Cust. Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line"; AccNo: Code[20]; var CustomAppliesToId: Code[50]; var IsHandled: Boolean)` (integration): Integration event raised after setting filters on customer ledger entries during application selection. Enables custom filtering logic for customer entry selection processes.
- `OnAfterVendLedgEntrySetFilters(var VendorLedgerEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; AccNo: Code[20])` (integration): Integration event raised after setting filters on vendor ledger entries during application selection. Enables custom filtering logic for vendor entry selection processes.
- `OnAfterApplyEmployeeLedgerEntry(var GenJournalLine: Record "Gen. Journal Line"; EmployeeLedgerEntry: Record "Employee Ledger Entry")` (integration): Integration event raised after applying employee ledger entry with general journal line. Enables custom post-processing logic for employee payment applications.
- `OnAfterSelectCustLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean)` (integration): Integration event raised after selecting a customer ledger entry for application. Enables customization of the customer selection process and additional validation.
- `OnAfterSelectEmplLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean)` (integration): Integration event raised after selecting an employee ledger entry for application. Enables customization of the employee selection process and additional validation.
- `OnAfterSelectVendLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean)` (integration): Integration event raised after selecting a vendor ledger entry for application. Enables customization of the vendor selection process and additional validation.
- `OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrency(var GenJournalLine: Record "Gen. Journal Line"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before checking application currency for customer ledger entries. Enables custom currency validation logic for customer applications.
- `OnApplyCustomerLedgerEntryOnBeforeModify(var GenJnlLine: Record "Gen. Journal Line"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before modifying a customer ledger entry during application. Enables custom field updates and validation before the ledger entry is modified.
- `OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrency(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency for vendor ledger entries. Enables custom currency validation logic for vendor applications.
- `OnApplyVendorLedgerEntryOnBeforeModify(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntryLocal: Record "Vendor Ledger Entry")` (integration): Integration event raised before modifying a vendor ledger entry during application. Enables custom field updates and validation before the ledger entry is modified.
- `OnApplyEmployeeLedgerEntryOnBeforeUpdateAmount(var GenJournalLine: Record "Gen. Journal Line"; EmployeeLedgerEntry: Record "Employee Ledger Entry")` (integration): Integration event raised before updating amount for employee ledger entry applications. Enables custom amount calculation logic for employee transactions.
- `OnBeforeRun(var GenJnlLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration): Integration event raised before starting the general journal application process. Enables custom preprocessing logic and allows complete replacement of standard application logic.
- `OnBeforeCheckAgainstApplnCurrency(var ApplnCurrencyCode: Code[10]; var CompareCurrencyCode: Code[10])` (integration): Integration event raised before checking currency compatibility during application. Enables custom currency validation logic and currency code modification.
- `OnBeforeFindCustApply(GenJournalLine: Record "Gen. Journal Line"; CustLedgerEntry: Record "Cust. Ledger Entry"; var Amount: Decimal; var IsHandled: Boolean)` (integration): Integration event raised before finding customer ledger entries for application. Enables custom application logic and amount calculation for customer entries.
- `OnBeforeFindVendApply(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var Amount: Decimal; var IsHandled: Boolean)` (integration): Integration event raised before finding vendor ledger entries for application. Enables custom application logic and amount calculation for vendor entries.
- `OnBeforeSelectCustLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean; var IsHandled: Boolean; var CustomAppliesToId: Code[50])` (integration): Integration event raised before selecting customer ledger entries for application. Enables custom selection logic and filtering for customer applications.
- `OnBeforeSelectEmplLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean; var IsHandled: Boolean)` (integration): Integration event raised before selecting employee ledger entries for application. Enables custom selection logic and filtering for employee applications.
- `OnBeforeSelectVendLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var AccNo: Code[20]; var Selected: Boolean; var IsHandled: Boolean; var CustomAppliesToId: Code[50])` (integration): Integration event raised before selecting vendor ledger entries for application. Enables custom selection logic and filtering for vendor applications.
- `OnSelectCustLedgEntryOnAfterSetFilters(var CustLedgerEntry: Record "Cust. Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")` (integration): Integration event raised after setting filters for customer ledger entry selection. Enables custom filtering and additional selection criteria for customer entries.
- `OnSelectEmplLedgEntryOnAfterSetFilters(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")` (integration): Integration event raised after setting filters for employee ledger entry selection. Enables custom filtering and additional selection criteria for employee entries.
- `OnSelectVendLedgEntryOnAfterSetFilters(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")` (integration): Integration event raised after setting filters for vendor ledger entry selection. Enables custom filtering and additional selection criteria for vendor entries.
- `OnApplyVendorLedgerEntryOnBeforeConfirmUpdateCurrency(var GenJournalLine: Record "Gen. Journal Line"; CurrencyCode: Code[10]; var IsHandled: Boolean)` (integration): Integration event raised before confirming currency update for vendor applications. Enables custom confirmation logic and currency update handling.
- `OnApplyCustomerLedgerEntryOnBeforeConfirmUpdateCurrency(var GenJournalLine: Record "Gen. Journal Line"; CurrencyCode: Code[10]; var IsHandled: Boolean)` (integration): Integration event raised before confirming currency update for customer applications. Enables custom confirmation logic and currency update handling.
- `OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrencyCustomerAmountNotZero(GenJournalLine: Record "Gen. Journal Line"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before checking application currency when customer amount is not zero. Enables custom currency validation for non-zero customer application amounts.
- `OnApplyCustomerLedgerEntryOnBeforeCheckAgainstApplnCurrencyCustomer(GenJournalLine: Record "Gen. Journal Line"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before checking application currency for customer applications. Enables custom currency validation logic for customer ledger entries.
- `OnApplyCustomerLedgerEntryOnAfterValidateAmount(var GenJnlLine: Record "Gen. Journal Line"; var CustLedgEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after validating amount in customer ledger entry application. Enables custom processing after amount validation is complete.
- `OnSetVendApplIdAPIOnBeforeCheckAgainstApplnCurrency(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency in vendor API operations. Enables custom currency validation for vendor applications via API.
- `OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyAmountZero(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency when vendor API amount is zero. Enables custom currency validation for zero-amount vendor applications via API.
- `OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyAmountNonZero(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency when vendor API amount is non-zero. Enables custom currency validation for non-zero vendor applications via API.
- `OnApplyVendorLedgerEntryAPIOnBeforeCheckAgainstApplnCurrencyDifferentCurrenciesAmountNonZero(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency for different currencies with non-zero vendor API amounts. Enables custom currency validation when vendor API applications involve different currencies.
- `OnApplyVendorLedgerEntryOnAfterSetGenJnlLineAppliesToDocNo(var GenJournalLine: Record "Gen. Journal Line"; var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after setting applies-to document number for vendor applications. Enables custom processing after vendor application document linking is established.
- `OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrencyAmountNotZero(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency when vendor amount is not zero. Enables custom currency validation for non-zero vendor application amounts.
- `OnApplyVendorLedgerEntryOnBeforeCheckAgainstApplnCurrencyDifferentCurrenciesAmountNotZero(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking application currency for different currencies with non-zero vendor amounts. Enables custom currency validation when vendor applications involve different currencies and non-zero amounts.
- `OnApplyCustomerLedgerEntryOnAfterSetCustomerAppliesToDocNo(var GenJournalLine: Record "Gen. Journal Line"; var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after setting applies-to document number for customer applications. Enables custom processing after customer application document linking is established.
- `OnApplyVendorLedgerEntryOnAfterSetVendorAppliesToDocNo(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after setting applies-to document number for vendor applications. Enables custom processing after vendor application document linking is established.
- `OnBeforeUpdateCustLedgEntry(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration): Integration event raised before updating customer ledger entries during application. Enables custom update logic and validation before customer ledger entry modification.
- `OnBeforeUpdateVendLedgEntry(var VendorLedgerEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)` (integration): Integration event raised before updating vendor ledger entries during application. Enables custom update logic and validation before vendor ledger entry modification.
- `OnAfterUpdateVendLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after updating vendor ledger entries during application. Enables custom processing after vendor ledger entry modification is complete.
- `OnApplyVendorLedgerEntryAPIOnBeforeValidateAmount(var GenJournalLine: Record "Gen. Journal Line")` (integration): Integration event raised before validating amount in vendor API applications. Enables custom amount validation logic for vendor applications via API.
- `OnApplyVendorLedgerEntryOnBeforeValidateAmount(var GenJournalLine: Record "Gen. Journal Line"; var VendorLedgEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before validating amount in vendor applications. Enables custom amount validation logic for standard vendor ledger entry applications.
- `OnSetVendApplIdAPIOnBeforeCheckPostingDate(var TempApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line"; var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before checking posting date in vendor API applications. Enables custom posting date validation for vendor applications via API.
- `OnCalcAppliedAmountOnCustLedgerEntryOnAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after calculating remaining amount in customer ledger entry applied amount calculation. Enables custom processing after remaining amount calculation is complete.

## Procedures

- `CheckAgainstApplnCurrency(ApplnCurrencyCode: Code[10]; CompareCurrencyCode: Code[10]; AccType: Enum "Gen. Journal Account Type"; Message: Boolean): Boolean`: Validates currency compatibility between application currency and comparison currency for payment applications. Checks application between currencies setup and EMU currency configuration.
- `SetVendApplIdAPI(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")`: Sets vendor application ID for API-based vendor ledger entry applications. Validates currency compatibility and updates vendor ledger entry for application.
- `ApplyVendorLedgerEntryAPI(var GenJournalLine: Record "Gen. Journal Line")`: Applies vendor ledger entries through API with comprehensive validation and currency checking. Processes application IDs and validates currency compatibility for API-based applications.
- `GetEntrySelected(): Boolean`

Plus 15 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 81 "Gen. Journal Line"](../table/81.md)

## Calls

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.

- [Codeunit 426 "Payment Tolerance Management"](../codeunit/426.md) (10 calls: `ApplyCustomerLedgerEntry → CheckCalcPmtDiscGenJnlCust`, `ApplyCustomerLedgerEntry → DelPmtTolApllnDocNo`, `ApplyCustomerLedgerEntry → PmtTolGenJnl`, …)
- [Codeunit 111 "Vend. Entry-SetAppl.ID"](../codeunit/111.md) (1 call: `SetVendApplIdAPI → SetApplId`)
- [Codeunit 27 "Confirm Management"](../codeunit/27.md) (1 call: `ConfirmCurrencyUpdate → GetResponseOrDefault`)

## Called by

- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (2 calls: `PrepareTempCustLedgEntry → CheckAgainstApplnCurrency`, `PrepareTempVendLedgEntry → CheckAgainstApplnCurrency`)
- [Page 30073 "APIV2 - Apply Vendor Entries"](../page/30073.md) (2 calls: `OnModifyRecord → ApplyVendorLedgerEntryAPI`, `OnModifyRecord → SetVendApplIdAPI`)
- [Page 1693 "Bank Deposit Subform"](../page/1693.md) (1 call: `ShowApplyEntries → (object)`)
- [Page 232 "Apply Customer Entries"](../page/232.md) (1 call: `CheckCustLedgEntry → CheckAgainstApplnCurrency`)
- [Page 233 "Apply Vendor Entries"](../page/233.md) (1 call: `CheckVendLedgEntry → CheckAgainstApplnCurrency`)
- [Page 234 "Apply Employee Entries"](../page/234.md) (1 call: `SetEmplApplId → CheckAgainstApplnCurrency`)
- [Page 5939 "Serv. Apply Customer Entries"](../page/5939.md) (1 call: `CheckCustLedgEntry → CheckAgainstApplnCurrency`)
- [Table 81 "Gen. Journal Line"](../table/81.md) (1 call: `CheckModifyCurrencyCode → CheckAgainstApplnCurrency`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-26

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: "Gen. Jnl.-Apply")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
