---
id: object/codeunit/227
type: object
title: Codeunit 227 "VendEntry-Apply Posted Entries"
summary: Codeunit 227 "VendEntry-Apply Posted Entries" in Base Application (Microsoft.Purchases.Payables). 15 public procedures, 29 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "24"
  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: dc38ba0040495182667fb01e127c51dc76c5a941bc3b6a77fb39201bed60f32d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Payables/VendEntryApplyPostedEntries.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/Payables/VendEntryApplyPostedEntries.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/au
    - localization/es
    - localization/it
    - localization/nz
    - localization/ru
  videos: []
  posts: []
  guidelines: []
object_type: codeunit
object_id: 227
name: VendEntry-Apply Posted Entries
namespace: Microsoft.Purchases.Payables
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
source_major: "29"
obsolete: null
countries:
  - au
  - es
  - it
  - nz
  - ru
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 57
  events: 29
  subscribers: 1
relations:
  out: 1
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 8
  called_by: 4
  implements: 0
---

# Codeunit 227 "VendEntry-Apply Posted Entries"

> Codeunit 227 "VendEntry-Apply Posted Entries" in Base Application (Microsoft.Purchases.Payables). 15 public procedures, 29 events, 1 event subscribers. Present since at least BC23, still in BC30, changed in BC24.

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

## Properties

| Property | Value |
|---|---|
| TableNo | Vendor Ledger Entry |
| Permissions | TableData "Vendor Ledger Entry" = rimd |

## Events published

- `OnAfterCheckReversal(VendLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnAfterPostApplyVendLedgEntry(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")` (integration)
- `OnAfterPostUnapplyVendLedgEntry(GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var TempVendorLedgerEntry: Record "Vendor Ledger Entry" temporary)` (integration)
- `OnAfterUnApplyVendor(DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry")` (integration)
- `OnApplyVendEntryFormEntryOnAfterCheckEntryOpen(ApplyingVendLedgEntry: Record "Vendor Ledger Entry")` (integration)
- `OnApplyVendEntryFormEntryOnBeforeRunVendEntryEdit(var ApplyingVendLedgEntry: Record "Vendor Ledger Entry")` (integration)
- `OnApplyVendEntryFormEntryOnAfterVendLedgEntrySetFilters(var VendorLedgEntry: Record "Vendor Ledger Entry"; var ApplyToVendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean; var VendEntryApplID: Code[50])` (integration)
- `OnBeforeApply(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var DocumentNo: Code[20]; var ApplicationDate: Date)` (integration)
- `OnBeforeApplyVendEntryFormEntry(var ApplyingVendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetApplicationDate(VendorLedgEntry: Record "Vendor Ledger Entry"; var ApplicationDate: Date; var IsHandled: Boolean)` (integration)
- `OnBeforePostApplyVendLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")` (integration)
- `OnBeforePostUnapplyVendLedgEntry(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry"; DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")` (integration)
- `OnCollectAffectedLedgerEntriesOnAfterSetFilters(var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; DetailedVendorLedgEntry2: Record "Detailed Vendor Ledg. Entry")` (integration)
- `OnFindLastApplEntryOnAfterSetFilters(var DetailedVendLedgEntry: Record "Detailed Vendor Ledg. Entry")` (integration)
- `OnBeforeVendPostApplyVendLedgEntry(var HideProgressWindow: Boolean; VendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)` (integration)
- `OnGetApplicationDateOnAfterSetFilters(var ApplyToVendLedgEntry: Record "Vendor Ledger Entry"; VendorLedgEntry: Record "Vendor Ledger Entry")` (integration)
- `OnBeforeRunUpdateAnalysisView(var IsHandled: Boolean)` (integration)
- `OnBeforeRunVendExchRateAdjustment(var GenJnlLine: Record "Gen. Journal Line"; var TempVendorLedgerEntry: Record "Vendor Ledger Entry" temporary; var IsHandled: Boolean)` (integration)
- `OnBeforePostUnApplyVendorCommit(var HideProgressWindow: Boolean; PreviewMode: Boolean; DetailedVendLedgEntry2: Record "Detailed Vendor Ledg. Entry"; DocNo: Code[20]; PostingDate: Date; CommitChanges: Boolean; var IsHandled: Boolean)` (integration)
- `OnCheckUnappliedEntriesOnBeforeUnapplyAllEntriesError(DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry"; LastTransactionNo: Integer; var IsHandled: Boolean)` (integration)
- `OnVendPostApplyVendLedgEntryOnBeforeCommit(var VendLedgerEntry: Record "Vendor Ledger Entry"; var SuppressCommit: Boolean)` (integration)
- `OnBeforeUnApplyVendor(DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry"; var IsHandled: Boolean)` (integration)
- `OnPostUnApplyVendorOnAfterDtldVendLedgEntrySetFilters(var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; DetailedVendorLedgEntry2: Record "Detailed Vendor Ledg. Entry")` (integration)
- `OnPostUnApplyVendorOnAfterGetVendLedgEntry(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration)
- `OnApplyOnBeforePmtTolVend(VendLedgEntry: Record "Vendor Ledger Entry"; var PaymentToleranceMgt: Codeunit "Payment Tolerance Management"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)
- `OnPostUnApplyVendorCommitOnBeforeFilterDtldVendLedgEntry(DetailedVendorLedgEntry2: Record "Detailed Vendor Ledg. Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")` (integration)
- `OnApplyOnBeforeVendPostApplyVendLedgEntry(VendorLedgerEntry: Record "Vendor Ledger Entry"; var ApplyUnapplyParameters: Record "Apply Unapply Parameters")` (integration)
- `OnApplyOnBeforePostingDateMustNotBeBeforeError(var ApplyUnapplyParameters: Record "Apply Unapply Parameters"; var VendorLedgerEntry: Record "Vendor Ledger Entry"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)
- `OnPostUnApplyVendorCommitOnBeforePostingDateMustNotBeBeforeError(var ApplyUnapplyParameters: Record "Apply Unapply Parameters"; var DetailedVendorLedgEntry2: Record "Detailed Vendor Ledg. Entry"; PreviewMode: Boolean; var IsHandled: Boolean)` (integration)

## Event subscriptions

- OnRunPreview subscribes to Codeunit "Gen. Jnl.-Post Preview" OnRunPreview

## Procedures

- `Apply(VendLedgEntry: Record "Vendor Ledger Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters"): Boolean`
- `GetApplicationDate(VendLedgEntry: Record "Vendor Ledger Entry"): Date`
- `FindLastApplEntry(VendLedgEntryNo: Integer): Integer`
- `UnApplyDtldVendLedgEntry(DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry")`
- `UnApplyVendLedgEntry(VendLedgEntryNo: Integer)`
- `CheckVendorLedgerEntryToUnapply(VendorLedgerEntryNo: Integer; var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry")`
- `PostUnApplyVendor(DtldVendLedgEntry2: Record "Detailed Vendor Ledg. Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")`
- `PostUnApplyVendorCommit(DtldVendLedgEntry2: Record "Detailed Vendor Ledg. Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters"; CommitChanges: Boolean)`
- `CheckReversal(VendLedgEntryNo: Integer)`
- `ApplyVendEntryFormEntry(var ApplyingVendLedgEntry: Record "Vendor Ledger Entry")`
- `PreviewApply(VendorLedgerEntry: Record "Vendor Ledger Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")`
- `PreviewUnapply(DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")`
- `SetApplyContext(ApplyUnapplyParameters: Record "Apply Unapply Parameters")`
- `SetUnapplyContext(var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; ApplyUnapplyParameters: Record "Apply Unapply Parameters")`
- `GetAppliedVendLedgerEntries(var TempAppliedVendLedgerEntry: Record "Vendor Ledger Entry" temporary; VendLedgerEntryNo: Integer)`

Plus 12 local procedures.

## Triggers

OnRun

## Relations

- runs on [Table 25 "Vendor Ledger Entry"](../table/25.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 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (4 calls: `PostUnApplyVendorCommit → ThrowError`, `PreviewApply → Preview`, `PreviewUnapply → Preview`, …)
- [Codeunit 11 "Gen. Jnl.-Check Line"](../codeunit/11.md) (2 calls: `CheckPostingDate → DateNotAllowed`, `CheckPostingDate → SetGenJnlBatch`)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (2 calls: `PostUnApplyVendorCommit → UnapplyVendLedgEntry`, `VendPostApplyVendLedgEntry → VendPostApplyVendLedgEntry`)
- [Codeunit 426 "Payment Tolerance Management"](../codeunit/426.md) (2 calls: `Apply → PmtTolVend`, `PreviewApply → PmtTolVend`)
- [Codeunit 113 "Vend. Entry-Edit"](../codeunit/113.md) (1 call: `ApplyVendEntryFormEntry → (object)`)
- [Codeunit 410 "Update Analysis View"](../codeunit/410.md) (1 call: `RunUpdateAnalysisView → UpdateAll`)
- [Codeunit 599 "Exch. Rate Adjmt. Run Handler"](../codeunit/599.md) (1 call: `RunVendExchRateAdjustment → RunVendExchRateAdjustment`)
- [Codeunit 9500 "Sequence No. Mgt."](../codeunit/9500.md) (1 call: `OnRun → SetPreviewMode`)

## Called by

- [Codeunit 386 "Reverse Payment Rec. Journal"](../codeunit/386.md) (3 calls: `UnapplyVendorEntry → CheckVendorLedgerEntryToUnapply`, `UnapplyVendorEntry → PostUnApplyVendor`, `UnapplyVendorEntry → UnApplyVendLedgEntry`)
- [Page 233 "Apply Vendor Entries"](../page/233.md) (3 calls: `PostDirectApplication → Apply`, `PostDirectApplication → GetApplicationDate`, `PostDirectApplication → PreviewApply`)
- [Codeunit 1402 "Cancel Posted Purch. Cr. Memo"](../codeunit/1402.md) (1 call: `UnapplyEntries → PostUnApplyVendor`)
- [Codeunit 5280 "SAF-T Data Mgt."](../codeunit/5280.md) (1 call: `GetAppliedPurchaseCreditMemos → GetAppliedVendLedgerEntries`)

## Across versions

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

## Countries that replace it

[AU](../../localizations/au.md), [ES](../../localizations/es.md), [IT](../../localizations/it.md), [NZ](../../localizations/nz.md), [RU](../../localizations/ru.md)

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