---
title: "Codeunit 226 CustEntry-Apply Posted Entries"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/226-custentry-apply-posted-entries/
type: codeunit
id: 226
name: "CustEntry-Apply Posted Entries"
app: "Base Application"
namespace: Microsoft.Sales.Receivables
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/226-custentry-apply-posted-entries/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 226 CustEntry-Apply Posted Entries

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/226-custentry-apply-posted-entries/

| | |
| --- | --- |
| App | Base Application |
| Namespace | Microsoft.Sales.Receivables |
| Versions | 17-28 |
| Source file | Sales/Receivables/CustEntryApplyPostedEntries.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| Apply | (Record Cust. Ledger Entry, Code[20], Date) | Boolean | public | 17-22 | Pending 20.0 | Replaced by W1 implementation of Apply() |
| GetApplicationDate | (Record Cust. Ledger Entry) | Date | public | 17-28 | - | - |
| FindLastApplEntry | (Integer) | Integer | public | 17-28 | - | - |
| UnApplyDtldCustLedgEntry | (Record Detailed Cust. Ledg. Entry) | - | public | 17-28 | - | - |
| UnApplyCustLedgEntry | (Integer) | - | public | 17-28 | - | - |
| PostUnApplyCustomer | (Record Detailed Cust. Ledg. Entry, Code[20], Date) | - | public | 17-22 | Pending 20.0 | Replaced by PostUnApplyCustomer(DtldCustLedgEntry2; ApplyUnapplyParameters) |
| PostUnApplyCustomerCommit | (Record Detailed Cust. Ledg. Entry, Code[20], Date, Boolean) | - | public | 17-22 | Pending 20.0 | Replaced by PostUnApplyCustomerCommit(DtldCustLedgEntry2; ApplyUnapplyParameters; CommitChanges) |
| CheckReversal | (Integer) | - | public | 17-28 | - | - |
| ApplyCustEntryFormEntry | (var Record Cust. Ledger Entry) | - | public | 17-28 | - | - |
| PreviewApply | (Record Cust. Ledger Entry, Code[20], Date) | - | public | 17-22 | Pending 20.0 | Replaced by PreviewApply(CustLedgEntry; ApplyUnapplyParameters) |
| PreviewUnapply | (Record Detailed Cust. Ledg. Entry, Code[20], Date) | - | public | 17-22 | Pending 20.0 | Replaced by PreviewUnapply(DetailedCustLedgEntry; ApplyUnapplyParameters) |
| SetApplyContext | (Date, Code[20]) | - | public | 17-22 | Pending 20.0 | Replaced by SetApplyContext(ApplyUnapplyParameters) |
| SetUnapplyContext | (var Record Detailed Cust. Ledg. Entry, Date, Code[20]) | - | public | 17-22 | Pending 20.0 | Replaced by SetUnapplyContext(DetailedCustLedgEntry, ApplyUnapplyParameters) |
| GetAppliedCustLedgerEntries | (var Record Cust. Ledger Entry, Integer) | - | public | 18-28 | - | - |
| Apply | (Record Cust. Ledger Entry, Record Apply Unapply Parameters) | Boolean | public | 20-28 | - | - |
| PostUnApplyCustomer | (Record Detailed Cust. Ledg. Entry, Record Apply Unapply Parameters) | - | public | 20-28 | - | - |
| PostUnApplyCustomerCommit | (Record Detailed Cust. Ledg. Entry, Record Apply Unapply Parameters, Boolean) | - | public | 20-28 | - | - |
| PreviewApply | (Record Cust. Ledger Entry, Record Apply Unapply Parameters) | - | public | 20-28 | - | - |
| PreviewUnapply | (Record Detailed Cust. Ledg. Entry, Record Apply Unapply Parameters) | - | public | 20-28 | - | - |
| SetApplyContext | (Record Apply Unapply Parameters) | - | public | 20-28 | - | - |
| SetUnapplyContext | (var Record Detailed Cust. Ledg. Entry, Record Apply Unapply Parameters) | - | public | 20-28 | - | - |
| CheckCustLedgEntryToUnapply | (Integer, var Record Detailed Cust. Ledg. Entry) | - | public | 21-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterCheckReversal | (Record Cust. Ledger Entry) | 17-28 | - | - |
| Integration event | OnAfterPostApplyCustLedgEntry | (Record Gen. Journal Line, Record Cust. Ledger Entry, var Codeunit Gen. Jnl.-Post Line) | 17-28 | - | - |
| Integration event | OnAfterPostUnapplyCustLedgEntry | (Record Gen. Journal Line, Record Cust. Ledger Entry, Record Detailed Cust. Ledg. Entry, var Codeunit Gen. Jnl.-Post Line, Boolean) | 17 | - | - |
| Integration event | OnBeforeApply | (var Record Cust. Ledger Entry, var Code[20], var Date) | 17-28 | - | - |
| Integration event | OnBeforeGetApplicationDate | (Record Cust. Ledger Entry, var Date, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforePostApplyCustLedgEntry | (var Record Gen. Journal Line, Record Cust. Ledger Entry, var Codeunit Gen. Jnl.-Post Line) | 17-21 | - | - |
| Integration event | OnBeforePostUnapplyCustLedgEntry | (var Record Gen. Journal Line, Record Cust. Ledger Entry, Record Detailed Cust. Ledg. Entry, var Codeunit Gen. Jnl.-Post Line) | 17-21 | - | - |
| Integration event | OnCollectAffectedLedgerEntriesOnAfterSetFilters | (var Record Detailed Cust. Ledg. Entry, Record Detailed Cust. Ledg. Entry) | 17-28 | - | - |
| Integration event | OnGetApplicationDateOnAfterSetFilters | (var Record Cust. Ledger Entry, Record Cust. Ledger Entry) | 17-28 | - | - |
| Integration event | OnFindLastApplEntryOnAfterSetFilters | (var Record Detailed Cust. Ledg. Entry) | 17-28 | - | - |
| Integration event | OnPostUnApplyCustomerCommitOnAfterSetFilters | (var Record Detailed Cust. Ledg. Entry, Record Detailed Cust. Ledg. Entry) | 17-28 | - | - |
| Integration event | OnBeforeCustPostApplyCustLedgEntry | (var Boolean, Record Cust. Ledger Entry) | 17-18 | - | - |
| Integration event | OnApplyApplyCustEntryFormEntryOnAfterCustLedgEntrySetFilters | (var Record Cust. Ledger Entry, var Record Cust. Ledger Entry, var Boolean) | 17-23 | - | - |
| Integration event | OnBeforePostUnApplyCustomerCommit | (var Boolean) | 17-18 | - | - |
| Integration event | OnCheckunappliedEntriesOnBeforeUnapplyAllEntriesError | (Record Detailed Cust. Ledg. Entry, Integer, var Boolean) | 17-19 | - | - |
| Integration event | OnCustPostApplyCustLedgEntryOnBeforeCommit | (var Record Cust. Ledger Entry, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeUnApplyCustomer | (Record Detailed Cust. Ledg. Entry) | 17-22 | - | - |
| Integration event | OnPostUnApplyCustomerCommitOnAfterGetCustLedgEntry | (var Record Cust. Ledger Entry) | 17-28 | - | - |
| Integration event | OnApplyOnBeforePmtTolCust | (Record Cust. Ledger Entry, var Codeunit Payment Tolerance Management, Boolean, var Boolean) | 17-28 | - | - |
| Integration event | OnAfterPostUnapplyCustLedgEntry | (Record Gen. Journal Line, Record Cust. Ledger Entry, Record Detailed Cust. Ledg. Entry, var Codeunit Gen. Jnl.-Post Line, Boolean, var Record Cust. Ledger Entry) | 18 | - | - |
| Integration event | OnAfterPostUnapplyCustLedgEntry | (Record Gen. Journal Line, Record Cust. Ledger Entry, Record Detailed Cust. Ledg. Entry, var Codeunit Gen. Jnl.-Post Line, var Boolean, var Record Cust. Ledger Entry) | 19-28 | - | - |
| Integration event | OnAfterUnApplyCustomer | (Record Detailed Cust. Ledg. Entry) | 19-28 | - | - |
| Integration event | OnApplyCustEntryFormEntryOnAfterCheckEntryOpen | (Record Cust. Ledger Entry) | 19-28 | - | - |
| Integration event | OnApplyCustEntryFormEntryOnBeforeRunCustEntryEdit | (var Record Cust. Ledger Entry) | 19-28 | - | - |
| Integration event | OnBeforeCustPostApplyCustLedgEntry | (var Boolean, Record Cust. Ledger Entry, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeRunCustExchRateAdjustment | (var Record Gen. Journal Line, var Record Cust. Ledger Entry, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforePostUnApplyCustomerCommit | (var Boolean, Boolean, Record Detailed Cust. Ledg. Entry, Code[20], Date, Boolean, var Boolean) | 19-28 | - | - |
| Integration event | OnBeforeApplyCustEntryFormEntry | (var Record Cust. Ledger Entry, var Boolean) | 20-28 | - | - |
| Integration event | OnBeforeRunUpdateAnalysisView | (var Boolean) | 20-28 | - | - |
| Integration event | OnCheckUnappliedEntriesOnBeforeUnapplyAllEntriesError | (Record Detailed Cust. Ledg. Entry, Integer, var Boolean) | 20-28 | - | - |
| Integration event | OnBeforePostApplyCustLedgEntry | (var Record Gen. Journal Line, Record Cust. Ledger Entry, var Codeunit Gen. Jnl.-Post Line, Record Apply Unapply Parameters) | 22-28 | - | - |
| Integration event | OnBeforePostUnapplyCustLedgEntry | (var Record Gen. Journal Line, Record Cust. Ledger Entry, Record Detailed Cust. Ledg. Entry, var Codeunit Gen. Jnl.-Post Line, Record Apply Unapply Parameters) | 22-28 | - | - |
| Integration event | OnApplyOnBeforeCustPostApplyCustLedgEntry | (Record Cust. Ledger Entry, var Record Apply Unapply Parameters) | 22-28 | - | - |
| Integration event | OnPostUnApplyCustomerCommitOnBeforeFilterDtldCustLedgEntry | (Record Detailed Cust. Ledg. Entry, Record Apply Unapply Parameters) | 22-28 | - | - |
| Integration event | OnBeforeUnApplyCustomer | (Record Detailed Cust. Ledg. Entry, var Boolean) | 23-28 | - | - |
| Integration event | OnApplyApplyCustEntryFormEntryOnAfterCustLedgEntrySetFilters | (var Record Cust. Ledger Entry, var Record Cust. Ledger Entry, var Boolean, var Code[50]) | 24-28 | - | - |
| Integration event | OnPostUnApplyCustomerCommitOnAfterPreviewMode | (Record Cust. Ledger Entry) | 27-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
