---
id: object/table/21
type: object
title: Table 21 "Cust. Ledger Entry"
summary: Table 21 "Cust. Ledger Entry" in Base Application (Microsoft.Sales.Receivables). 91 fields, 17 public procedures, 20 events. Present since at least BC23, still in BC30, changed in BC24-26, BC28-29.
tier: official
language: en
tags:
  - table
  - base application
versions:
  introduced: null
  last_changed: "29"
  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: 28993eb635c9da3805c4a793f532e505f73e31cb3bcef84d46b0137f7fb3aab4
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al
    title: src/Layers/W1/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn:
    - https://learn.microsoft.com/dynamics365/business-central/analysis-assist
    - https://learn.microsoft.com/dynamics365/business-central/analysis-mode
    - https://learn.microsoft.com/dynamics365/business-central/finance-how-enable-application-ledger-entries-different-currencies
    - https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Mexico/how-to-generate-electronic-invoices
    - https://learn.microsoft.com/dynamics365/business-central/receivables-collect-outstanding-balances
    - https://learn.microsoft.com/dynamics365/business-central/receivables-how-apply-sales-transactions-manually
    - https://learn.microsoft.com/dynamics365/business-central/ui-extensions-late-payment-prediction
  objects: []
  features: []
  topics:
    - topic/business-central/analytics-business-intelligence-and-repo/ad-hoc-data-analysis
    - topic/business-central/business-functionality/finance/manage-payables
    - topic/business-central/business-functionality/finance/manage-receivables
    - topic/business-central/business-functionality/local-functionality/mexico/electronic-invoice
    - topic/business-central/business-functionality/set-up-business-central/set-up-finance
    - topic/business-central/copilot-and-agent-capabilities/analysis-assist
    - topic/business-central/development-and-administration/customize-business-central/customize-with-extensions
    - topic/dev-itpro/development/data-analytics-and-reporting
    - topic/dev-itpro/development/programming-in-the-al-language/tables-and-data/using-query-objects
  localizations:
    - localization/au
    - localization/ca
    - localization/ch
    - localization/es
    - localization/fi
    - localization/is
    - localization/it
    - localization/mx
    - localization/nl
    - localization/nz
    - localization/ru
    - localization/us
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/10840
    - change/bcapps/9089
object_type: table
object_id: 21
name: Cust. Ledger Entry
namespace: Microsoft.Sales.Receivables
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"
  - "28"
  - "29"
source_major: "29"
obsolete: null
countries:
  - au
  - ca
  - ch
  - es
  - fi
  - is
  - it
  - mx
  - nl
  - nz
  - ru
  - us
ms_search_form_ids: []
counts:
  fields: 91
  procedures: 39
  events: 20
  subscribers: 0
relations:
  out: 44
  referenced_by: 46
  pages: 9
  extended_by: 3
  event_subscribers: 13
  calls: 7
  called_by: 0
  implements: 0
---

# Table 21 "Cust. Ledger Entry"

> Table 21 "Cust. Ledger Entry" in Base Application (Microsoft.Sales.Receivables). 91 fields, 17 public procedures, 20 events. Present since at least BC23, still in BC30, changed in BC24-26, BC28-29.

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

Learn documents this table through its pages: [Page 25 "Customer Ledger Entries"](../page/25.md) (6 Learn pages), [Page 1951 "LP Prediction FactBox"](../page/1951.md) (1).

## Properties

| Property | Value |
|---|---|
| Caption | Cust. Ledger Entry |
| DataClassification | CustomerContent |
| Permissions | tabledata "Reminder/Fin. Charge Entry" = R |

## Fields

Explanation: the field's ToolTip in the code; without one, the ToolTip of a page control bound to the field (marked via the page); without that, its Caption (marked caption) when that differs from the name.

| No. | Name | Type | Explanation | Notes |
|---|---|---|---|---|
| 1 | Entry No. | Integer | Specifies the number of the entry, as assigned from the specified number series when the entry was created. |  |
| 3 | Customer No. | Code[20] | Specifies the customer account number that the entry is linked to. | TableRelation [Table 18 "Customer"](../table/18.md) |
| 4 | Posting Date | Date | Specifies the customer entry's posting date. |  |
| 5 | Document Type | Enum "Gen. Journal Document Type" | Specifies the document type that the customer entry belongs to. | enum [Enum 6 "Gen. Journal Document Type"](../enum/6.md) |
| 6 | Document No. | Code[20] | Specifies the entry's document number. |  |
| 7 | Description | Text[100] | Specifies a description of the customer entry. |  |
| 8 | Customer Name | Text[100] | Specifies the customer name that the entry is linked to. |  |
| 10 | Your Reference | Text[35] | Specifies the customer's reference. |  |
| 11 | Currency Code | Code[10] | Specifies the currency code for the amount on the line. | TableRelation [Table 4 "Currency"](../table/4.md) |
| 13 | Amount | Decimal | Specifies the amount of the entry. | FlowField: sum("Detailed Cust. Ledg. Entry".Amount where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 14 | Remaining Amount | Decimal | Specifies the amount that remains to be applied to before the entry has been completely applied. | FlowField: sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"), "Excluded from calculation" = const(false))); not editable |
| 15 | Original Amt. (LCY) | Decimal | Specifies the amount that the entry originally consisted of, in LCY. | FlowField: sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Cust. Ledger Entry No." = field("Entry No."), "Entry Type" = filter("Initial Entry"), "Posting Date" = field("Date Filter"))); not editable |
| 16 | Remaining Amt. (LCY) | Decimal | Specifies the amount that remains to be applied to before the entry is totally applied to. | FlowField: sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"), "Excluded from calculation" = const(false))); not editable |
| 17 | Amount (LCY) | Decimal | Specifies the amount of the entry in LCY. | FlowField: sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 18 | Sales (LCY) | Decimal | Specifies the total sales amount excl. VAT to the customer in LCY. |  |
| 19 | Profit (LCY) | Decimal | — |  |
| 20 | Inv. Discount (LCY) | Decimal | — |  |
| 21 | Sell-to Customer No. | Code[20] | — | TableRelation [Table 18 "Customer"](../table/18.md) |
| 22 | Customer Posting Group | Code[20] | Specifies the customer's market type to link business transactions to. | TableRelation [Table 92 "Customer Posting Group"](../table/92.md) (Customer Posting Group) |
| 23 | Global Dimension 1 Code | Code[20] | Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company's most important activities, are available on all cards, documents, reports, and lists. | TableRelation [Table 349 "Dimension Value"](../table/349.md) ("Dimension Value".Code where("Global Dimension No." = const(1))) |
| 24 | Global Dimension 2 Code | Code[20] | Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company's most important activities, are available on all cards, documents, reports, and lists. | TableRelation [Table 349 "Dimension Value"](../table/349.md) ("Dimension Value".Code where("Global Dimension No." = const(2))) |
| 25 | Salesperson Code | Code[20] | Specifies the code for the salesperson whom the entry is linked to. | TableRelation [Table 13 "Salesperson/Purchaser"](../table/13.md) (Salesperson/Purchaser) |
| 27 | User ID | Code[50] | Specifies the ID of the user who posted the entry, to be used, for example, in the change log. | TableRelation User."User Name"; DataClassification EndUserIdentifiableInformation |
| 28 | Source Code | Code[10] | Specifies the source code that specifies where the entry was created. | TableRelation [Table 230 "Source Code"](../table/230.md) (Source Code) |
| 33 | On Hold | Code[3] | Specifies that the related entry represents an unpaid invoice for which either a payment suggestion, a reminder, or a finance charge memo exists. |  |
| 34 | Applies-to Doc. Type | Enum "Gen. Journal Document Type" | — | enum [Enum 6 "Gen. Journal Document Type"](../enum/6.md) |
| 35 | Applies-to Doc. No. | Code[20] | — |  |
| 36 | Open | Boolean | Specifies whether the amount on the entry has been fully paid or there is still a remaining amount that must be applied to. |  |
| 37 | Due Date | Date | Specifies the due date on the entry. |  |
| 38 | Pmt. Discount Date | Date | Specifies the date on which the amount in the entry must be paid for a payment discount to be granted. |  |
| 39 | Original Pmt. Disc. Possible | Decimal | Specifies the discount that the customer can obtain if the entry is applied to before the payment discount date. | not editable |
| 40 | Pmt. Disc. Given (LCY) | Decimal | — |  |
| 42 | Orig. Pmt. Disc. Possible(LCY) | Decimal | Orig. Pmt. Disc. Possible (LCY) <small>caption</small> | not editable |
| 43 | Positive | Boolean | Specifies if the entry to be applied is positive. |  |
| 44 | Closed by Entry No. | Integer | — | TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md) (Cust. Ledger Entry) |
| 45 | Closed at Date | Date | Specifies when the entry was closed. |  |
| 46 | Closed by Amount | Decimal | Specifies the amount that the entry was finally applied to (closed) with. |  |
| 47 | Applies-to ID | Code[50] | Specifies the ID of entries that will be applied to when you choose the Apply Entries action. |  |
| 48 | Journal Templ. Name | Code[10] | Journal Template Name <small>caption</small> |  |
| 49 | Journal Batch Name | Code[10] | — |  |
| 50 | Reason Code | Code[10] | Specifies the reason code, a supplementary source code that enables you to trace the entry. | TableRelation [Table 231 "Reason Code"](../table/231.md) (Reason Code) |
| 51 | Bal. Account Type | Enum "Gen. Journal Account Type" | Specifies the type of account that a balancing entry is posted to, such as BANK for a cash account. | enum [Enum 81 "Gen. Journal Account Type"](../enum/81.md) |
| 52 | Bal. Account No. | Code[20] | Specifies the number of the general ledger, customer, vendor, or bank account that the balancing entry is posted to, such as a cash account for cash purchases. | TableRelation [Table 15 "G/L Account"](../table/15.md), [Table 18 "Customer"](../table/18.md), [Table 23 "Vendor"](../table/23.md) (if ("Bal. Account Type" = const("G/L Account")) "G/L Account" else if ("Bal. Account Type" = const(Customer)) Customer else if ("Bal. Account Type" = const(Vendor)) Vendor else if ("Bal. Account Type" = const("Bank Account")) "Bank Account" else if ("Bal. Account Type" = const("Fixed Asset")) "Fixed...) |
| 53 | Transaction No. | Integer | Specifies the transaction number that groups related G/L entries from the same posting. | TableRelation [Table 57 "G/L Transaction"](../table/57.md) (G/L Transaction) |
| 54 | Closed by Amount (LCY) | Decimal | — |  |
| 58 | Debit Amount | Decimal | Specifies the total of the ledger entries that represent debits. | FlowField: sum("Detailed Cust. Ledg. Entry"."Debit Amount" where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 59 | Credit Amount | Decimal | Specifies the total of the ledger entries that represent credits. | FlowField: sum("Detailed Cust. Ledg. Entry"."Credit Amount" where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 60 | Debit Amount (LCY) | Decimal | Specifies the total of the ledger entries that represent debits, expressed in LCY. | FlowField: sum("Detailed Cust. Ledg. Entry"."Debit Amount (LCY)" where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 61 | Credit Amount (LCY) | Decimal | Specifies the total of the ledger entries that represent credits, expressed in LCY. | FlowField: sum("Detailed Cust. Ledg. Entry"."Credit Amount (LCY)" where("Ledger Entry Amount" = const(true), "Cust. Ledger Entry No." = field("Entry No."), "Posting Date" = field("Date Filter"))); not editable |
| 62 | Document Date | Date | Specifies the customer entry's document date. |  |
| 63 | External Document No. | Code[35] | Specifies a document number that refers to the customer's or vendor's numbering system. |  |
| 64 | Calculate Interest | Boolean | — |  |
| 65 | Closing Interest Calculated | Boolean | — |  |
| 66 | No. Series | Code[20] | — | TableRelation [Table 308 "No. Series"](../table/308.md) (No. Series) |
| 67 | Closed by Currency Code | Code[10] | Specifies the code of the currency of the entry that was applied to (and closed) this customer ledger entry. | TableRelation [Table 4 "Currency"](../table/4.md) |
| 68 | Closed by Currency Amount | Decimal | Specifies the amount that was finally applied to (and closed) this customer ledger entry. |  |
| 73 | Adjusted Currency Factor | Decimal | — |  |
| 74 | Original Currency Factor | Decimal | — |  |
| 75 | Original Amount | Decimal | Specifies the amount of the original entry. | FlowField: sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No."), "Entry Type" = filter("Initial Entry"), "Posting Date" = field("Date Filter"))); not editable |
| 76 | Date Filter | Date | — | FlowFilter |
| 77 | Remaining Pmt. Disc. Possible | Decimal | Specifies the remaining payment discount which can be received if the payment is made before the payment discount date. |  |
| 78 | Pmt. Disc. Tolerance Date | Date | Specifies the latest date the amount in the entry must be paid in order for a payment discount tolerance to be granted. |  |
| 79 | Max. Payment Tolerance | Decimal | Specifies the maximum tolerated amount the entry can differ from the amount on the invoice or credit memo. |  |
| 80 | Last Issued Reminder Level | Integer | — |  |
| 81 | Accepted Payment Tolerance | Decimal | — |  |
| 82 | Accepted Pmt. Disc. Tolerance | Boolean | — |  |
| 83 | Pmt. Tolerance (LCY) | Decimal | — |  |
| 84 | Amount to Apply | Decimal | Specifies the amount to apply. |  |
| 85 | IC Partner Code | Code[20] | Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction. | TableRelation [Table 413 "IC Partner"](../table/413.md) (IC Partner) |
| 86 | Applying Entry | Boolean | — |  |
| 87 | Reversed | Boolean | Specifies if the entry has been part of a reverse transaction. |  |
| 88 | Reversed by Entry No. | Integer | Specifies the number of the correcting entry that replaced the original entry in the reverse transaction. | TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md) (Cust. Ledger Entry) |
| 89 | Reversed Entry No. | Integer | Specifies the number of the original entry that was undone by the reverse transaction. | TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md) (Cust. Ledger Entry) |
| 90 | Prepayment | Boolean | Specifies if the related payment is a prepayment. |  |
| 95 | G/L Register No. | Integer | Specifies the G/L register number that groups related G/L entries from the same posting. | TableRelation [Table 45 "G/L Register"](../table/45.md) (G/L Register); not editable |
| 171 | Payment Reference | Code[50] | — |  |
| 172 | Payment Method Code | Code[10] | Specifies how to make payment, such as with bank transfer, cash, or check. | TableRelation [Table 289 "Payment Method"](../table/289.md) (Payment Method) |
| 173 | Applies-to Ext. Doc. No. | Code[35] | — |  |
| 288 | Recipient Bank Account | Code[20] | Specifies the bank account to transfer the amount to. | TableRelation [Table 287 "Customer Bank Account"](../table/287.md) ("Customer Bank Account".Code where("Customer No." = field("Customer No."))) |
| 289 | Message to Recipient | Text[140] | Specifies the message exported to the payment file when you use the Export Payments to File function in the Payment Journal window. |  |
| 290 | Exported to Payment File | Boolean | Specifies that the entry was created as a result of exporting a payment journal line. | not editable |
| 480 | Dimension Set ID | Integer | Specifies a reference to a combination of dimension values. The actual values are stored in the Dimension Set Entry table. | TableRelation [Table 480 "Dimension Set Entry"](../table/480.md) (Dimension Set Entry); not editable |
| 481 | Shortcut Dimension 3 Code | Code[20] | Specifies the code for Shortcut Dimension 3, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(3))); not editable |
| 482 | Shortcut Dimension 4 Code | Code[20] | Specifies the code for Shortcut Dimension 4, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(4))); not editable |
| 483 | Shortcut Dimension 5 Code | Code[20] | Specifies the code for Shortcut Dimension 5, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(5))); not editable |
| 484 | Shortcut Dimension 6 Code | Code[20] | Specifies the code for Shortcut Dimension 6, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(6))); not editable |
| 485 | Shortcut Dimension 7 Code | Code[20] | Specifies the code for Shortcut Dimension 7, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(7))); not editable |
| 486 | Shortcut Dimension 8 Code | Code[20] | Specifies the code for Shortcut Dimension 8, which is one of dimension codes that you set up in the General Ledger Setup window. | FlowField: lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"), "Global Dimension No." = const(8))); not editable |
| 1200 | Direct Debit Mandate ID | Code[35] | Specifies the direct-debit mandate that the customer has signed to allow direct debit collection of payments. | TableRelation [Table 1230 "SEPA Direct Debit Mandate"](../table/1230.md) ("SEPA Direct Debit Mandate" where("Customer No." = field("Customer No."))) |
| 1340 | Dispute Status | Code[10] | Specifies if there is an ongoing dispute for this Invoice | TableRelation [Table 142 "Dispute Status"](../table/142.md) (Dispute Status) |
| 1341 | Promised Pay Date | Date | Specifies the date on which the customer have promised to pay this invoice. |  |

## Keys

- Key1: Entry No. (clustered)
- Key2: Customer No., Currency Code
- Key4: Document No.
- Key5: External Document No.
- Key6: Customer No., Open, Positive, Due Date, Currency Code
- Key7: Open, Due Date
- Key8: Customer No., Document Type, Posting Date, Currency Code
- Key9: Salesperson Code, Posting Date
- Key10: Closed by Entry No.
- Key11: Transaction No.
- Key17: Customer No., Applies-to ID, Open, Positive, Due Date
- Key18: Document Type, Posting Date
- Key19: Document Type, Customer No., Open, Due Date
- Key20: Customer Posting Group
- Key21: Document Type, Open, Posting Date, Closed at Date
- Key22: Salesperson Code
- Key23: SystemModifiedAt
- Key35: Customer No., Posting Date, Applies-to ID
- Key36: Document Type, Reversed, Posting Date
- Key37: Applies-to ID

## Events published

- `OnAfterCopyCustLedgerEntryFromGenJnlLine(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")` (integration): Raised after copying customer ledger entry fields from a general journal line.
- `OnAfterCopyCustLedgerEntryFromCVLedgEntryBuffer(var CustLedgerEntry: Record "Cust. Ledger Entry"; CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")` (integration): Raised after copying customer ledger entry fields from a CV ledger entry buffer.
- `OnAfterRecalculateAmounts(var CustLedgerEntry: Record "Cust. Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)` (integration): Raised after recalculating amounts from one currency to another.
- `OnValidateAmounttoApplyBeforeFieldError(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Raised before validating the Amount to Apply field to allow custom validation.
- `OnAfterShowDoc(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Raised after attempting to show the document associated with the entry.
- `OnAfterShowPostedDocAttachment(var CustLedgerEntry: Record "Cust. Ledger Entry"; DocumentFound: Boolean)` (integration): Raised after showing the posted document attachment.
  - subscribers: [Codeunit 6450 "Serv. Integration Mgt."](../codeunit/6450.md) CustLedgerEntryOnAfterShowPostedDocAttachment
- `OnAfterHasPostedDocAttachment(var CustLedgerEntry: Record "Cust. Ledger Entry"; var HasPostedDocumentAttachment: Boolean)` (integration): Raised after checking whether the posted document has attachments.
  - subscribers: [Codeunit 6450 "Serv. Integration Mgt."](../codeunit/6450.md) CustLedgerEntryOnAfterHasPostedDocAttachment
- `OnBeforeDrillDownEntries(var CustLedgerEntry: Record "Cust. Ledger Entry"; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var DrillDownPageID: Integer)` (integration): Raised before drilling down on customer ledger entries.
- `OnBeforeDrillDownOnOverdueEntries(var CustLedgerEntry: Record "Cust. Ledger Entry"; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var DrillDownPageID: Integer)` (integration): Raised before drilling down on overdue customer ledger entries.
- `OnBeforeSetAmountToApply(var CustLedgerEntry: Record "Cust. Ledger Entry"; AppliesToDocNo: Code[20]; CustomerNo: Code[20])` (integration): Raised before setting the amount to apply for a customer ledger entry.
- `OnBeforeSetStyle(var Style: Text; var IsHandled: Boolean)` (integration): Raised before determining the visual style for the entry.
- `OnBeforeShowDoc(CustLedgerEntry: Record "Cust. Ledger Entry"; var IsPageOpened: Boolean; var IsHandled: Boolean)` (integration): Raised before showing the document associated with the entry.
  - subscribers: [Codeunit 6450 "Serv. Integration Mgt."](../codeunit/6450.md) CustLedgerEntryOnBeforeShowDoc
- `OnBeforeValidateMessagetoRecipient(var CustLedgerEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean)` (integration): Raised before validating the Message to Recipient field.
- `OnAfterUpdateAmountsForApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)` (integration): Raised after updating amounts for application.
- `OnAfterGetRemainingPmtDiscPossible(CustLedgerEntry: Record "Cust. Ledger Entry"; ReferenceDate: Date; var RemainingPmtDiscPossible: Decimal)` (integration): Raised after getting the remaining payment discount possible.
- `OnBeforeDrillDownOnOverdueEntriesBeforeCode(var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var IsHandled: Boolean)` (integration): Raised before drilling down on overdue entries to allow custom handling.
- `OnBeforeRecalculateAmounts(var CustLedgerEntry: Record "Cust. Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date; var IsHandled: Boolean)` (integration): Raised before recalculating amounts from one currency to another.
- `OnBeforeUpdateAmountsForApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean; var IsHandled: Boolean)` (integration): Raised before updating amounts for application.
- `OnSetAmountToApplyOnAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Raised after calculating the remaining amount when setting amount to apply.
- `OnValidateMaxPaymentToleranceOnBeforeFieldError(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Raised before validating the Max Payment Tolerance field to allow custom validation.

## Trigger event subscribers

- OnAfterDeleteEvent: [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) OnAfterDeleteCustomerLedgerEntry, [Codeunit 5508 "Graph Mgt - Sal. Cr. Memo Buf."](../codeunit/5508.md) OnAfterDeleteCustomerLedgerEntry
- OnAfterInsertEvent: [Codeunit 20 "Posting Preview Event Handler"](../codeunit/20.md) OnInsertCustLedgerEntry, [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) OnAfterInsertCustomerLedgerEntry, [Codeunit 5508 "Graph Mgt - Sal. Cr. Memo Buf."](../codeunit/5508.md) OnAfterInsertCustomerLedgerEntry
- OnAfterModifyEvent: [Codeunit 20 "Posting Preview Event Handler"](../codeunit/20.md) OnModifyCustLedgerEntry, [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) OnAfterModifyCustomerLedgerEntry, [Codeunit 5508 "Graph Mgt - Sal. Cr. Memo Buf."](../codeunit/5508.md) OnAfterModifyCustomerLedgerEntry
- OnAfterRenameEvent: [Codeunit 5477 "Sales Invoice Aggregator"](../codeunit/5477.md) OnAfterRenameCustomerLedgerEntry, [Codeunit 5508 "Graph Mgt - Sal. Cr. Memo Buf."](../codeunit/5508.md) OnAfterRenameCustomerLedgerEntry

## Procedures

- `GetLastEntryNo(): Integer`: Gets the entry number of the last customer ledger entry in the table.
- `ShowDoc(): Boolean`: Opens the appropriate posted document page based on the document type.
- `ShowPostedDocAttachment()`: Opens the document attachment details page for the posted document associated with this entry.
- `HasPostedDocAttachment(): Boolean`: Checks whether the posted document associated with this entry has any attachments.
- `DrillDownOnEntries(var DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry")`: Opens the Customer Ledger Entries page filtered by the specified detailed customer ledger entry filters.
- `DrillDownOnOverdueEntries(var DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry")`: Opens the Customer Ledger Entries page filtered to show only overdue entries.
- `GetOriginalCurrencyFactor(): Decimal`: Gets the original currency factor, returning 1 if not set.
- `GetAdjustedCurrencyFactor(): Decimal`: Gets the adjusted currency factor, returning 1 if not set.
- `ShowDimensions()`: Opens the Dimension Set Entries page showing the dimensions for this entry.
- `SetStyle(): Text`: Determines the visual style for displaying this entry based on its payment status.
- `SetApplyToFilters(CustomerNo: Code[20]; ApplyDocType: Option; ApplyDocNo: Code[20]; ApplyAmount: Decimal)`: Sets filters on the record to show entries that can be applied based on the specified criteria.
- `SetAmountToApply(AppliesToDocNo: Code[20]; CustomerNo: Code[20])`: Toggles the Amount to Apply field between the remaining amount and zero for the specified document.
- `CopyFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")`: Copies field values from a general journal line to this customer ledger entry.
- `CopyFromCVLedgEntryBuffer(var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")`: Copies field values from a CV ledger entry buffer to this customer ledger entry.
- `RecalculateAmounts(FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)`: Recalculates amount fields from one currency to another using exchange rates at the specified posting date.
- `UpdateAmountsForApplication(ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)`: Updates amount fields for application by converting to the application currency.
- `GetRemainingPmtDiscPossible(ReferenceDate: Date): Decimal`: Gets the remaining payment discount possible, allowing for customization through events.

Plus 2 local procedures.

## Relations

- drill-down page [Page 25 "Customer Ledger Entries"](../page/25.md)
- lookup page [Page 25 "Customer Ledger Entries"](../page/25.md)
- Direct Debit Mandate ID: TableRelation [Table 1230 "SEPA Direct Debit Mandate"](../table/1230.md)
- Salesperson Code: TableRelation [Table 13 "Salesperson/Purchaser"](../table/13.md)
- Dispute Status: TableRelation [Table 142 "Dispute Status"](../table/142.md)
- Bal. Account No.: TableRelation [Table 15 "G/L Account"](../table/15.md) (conditional)
- Bal. Account No.: TableRelation [Table 18 "Customer"](../table/18.md) (conditional)
- Customer No.: TableRelation [Table 18 "Customer"](../table/18.md)
- Sell-to Customer No.: TableRelation [Table 18 "Customer"](../table/18.md)
- Closed by Entry No.: TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md)
- Reversed by Entry No.: TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md)
- Reversed Entry No.: TableRelation [Table 21 "Cust. Ledger Entry"](../table/21.md)
- Bal. Account No.: TableRelation [Table 23 "Vendor"](../table/23.md) (conditional)
- Source Code: TableRelation [Table 230 "Source Code"](../table/230.md)
- Reason Code: TableRelation [Table 231 "Reason Code"](../table/231.md)
- Bal. Account No.: TableRelation [Table 270 "Bank Account"](../table/270.md) (conditional)
- Recipient Bank Account: TableRelation [Table 287 "Customer Bank Account"](../table/287.md)
- Payment Method Code: TableRelation [Table 289 "Payment Method"](../table/289.md)
- No. Series: TableRelation [Table 308 "No. Series"](../table/308.md)
- Global Dimension 1 Code: TableRelation [Table 349 "Dimension Value"](../table/349.md)
- Global Dimension 2 Code: TableRelation [Table 349 "Dimension Value"](../table/349.md)
- Amount: CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Amount (LCY): CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Credit Amount: CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Credit Amount (LCY): CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Debit Amount: CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Debit Amount (LCY): CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Original Amount: CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Original Amt. (LCY): CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Remaining Amount: CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Remaining Amt. (LCY): CalcFormula [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md)
- Closed by Currency Code: TableRelation [Table 4 "Currency"](../table/4.md)
- Currency Code: TableRelation [Table 4 "Currency"](../table/4.md)
- IC Partner Code: TableRelation [Table 413 "IC Partner"](../table/413.md)
- G/L Register No.: TableRelation [Table 45 "G/L Register"](../table/45.md)
- Shortcut Dimension 3 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Shortcut Dimension 4 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Shortcut Dimension 5 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Shortcut Dimension 6 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Shortcut Dimension 7 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Shortcut Dimension 8 Code: CalcFormula [Table 480 "Dimension Set Entry"](../table/480.md)
- Dimension Set ID: TableRelation [Table 480 "Dimension Set Entry"](../table/480.md)
- Transaction No.: TableRelation [Table 57 "G/L Transaction"](../table/57.md)
- Customer Posting Group: TableRelation [Table 92 "Customer Posting Group"](../table/92.md)

## Referenced by

46 fields in 32 objects relate to this table (TableRelation or CalcFormula).

- [Table 1208 "Direct Debit Collection Entry"](../table/1208.md): Applies-to Entry Currency Code, Applies-to Entry Description, Applies-to Entry Document No., Applies-to Entry Open, Applies-to Entry Posting Date, Payment Reference, Applies-to Entry No.
- [Table 18 "Customer"](../table/18.md): First Transaction Date, Inv. Discounts (LCY), Profit (LCY), Sales (LCY)
- [Table 112 "Sales Invoice Header"](../table/112.md): Closed, Reversed, Cust. Ledger Entry No.
- [Table 21 "Cust. Ledger Entry"](../table/21.md): Closed by Entry No., Reversed by Entry No., Reversed Entry No.
- [Table 114 "Sales Cr.Memo Header"](../table/114.md): Paid, Cust. Ledger Entry No.
- [Table 1053 "Line Fee Note on Report Hist."](../table/1053.md): Cust. Ledger Entry No
- [Table 1206 "Credit Transfer Entry"](../table/1206.md): Applies-to Entry No.
- [Table 1293 "Payment Application Proposal"](../table/1293.md): Applies-to Entry No.
- [Table 1294 "Applied Payment Entry"](../table/1294.md): Applies-to Entry No.
- [Table 1313 "Activities Cue"](../table/1313.md): Sales Invoices Due Next Week
- [Table 1692 "Posted Bank Deposit Line"](../table/1692.md): Entry No.
- [Table 179 "Reversal Entry"](../table/179.md): Entry No.
- [Table 296 "Reminder Line"](../table/296.md): Entry No.
- [Table 298 "Issued Reminder Line"](../table/298.md): Entry No.
- [Table 300 "Reminder/Fin. Charge Entry"](../table/300.md): Customer Entry No.
- [Table 30133 "Shpfy Order Transaction"](../table/30133.md): Used
- [Table 30154 "Shpfy Suggest Payment"](../table/30154.md): Customer Ledger Entry No.
- [Table 303 "Finance Charge Memo Line"](../table/303.md): Entry No.
- [Table 305 "Issued Fin. Charge Memo Line"](../table/305.md): Entry No.
- [Table 379 "Detailed Cust. Ledg. Entry"](../table/379.md): Cust. Ledger Entry No.
- [Table 382 "CV Ledger Entry Buffer"](../table/382.md): Closed by Entry No.
- [Table 4 "Currency"](../table/4.md): Cust. Ledg. Entries in Filter
- [Table 5475 "Sales Invoice Entity Aggregate"](../table/5475.md): Cust. Ledger Entry No.
- [Table 5495 "Sales Order Entity Buffer"](../table/5495.md): Cust. Ledger Entry No.
- [Table 5505 "Sales Quote Entity Buffer"](../table/5505.md): Cust. Ledger Entry No.
- [Table 5507 "Sales Cr. Memo Entity Buffer"](../table/5507.md): Cust. Ledger Entry No.
- [Table 57 "G/L Transaction"](../table/57.md): No. of Customer Ledger Entries
- [Table 6220 "Sustainability Cue"](../table/6220.md): Sales Invoices Due Next Week
- [Table 846 "Cash Flow Worksheet Line"](../table/846.md): Source No.
- [Table 847 "Cash Flow Forecast Entry"](../table/847.md): Source No.
- [Table 9054 "Finance Cue"](../table/9054.md): Overdue Sales Documents
- [Table 9060 "SB Owner Cue"](../table/9060.md): Overdue Sales Documents

## Pages and codeunits on this table

- [Page 1160 "Sales Documents"](../page/1160.md) (source table)
- [Page 126 "Cust. Ledg. Entries Preview"](../page/126.md) (source table)
- [Page 1951 "LP Prediction FactBox"](../page/1951.md) (source table)
- [Page 1954 "LP - Invoices at Risk"](../page/1954.md) (source table)
- [Page 232 "Apply Customer Entries"](../page/232.md) (source table)
- [Page 25 "Customer Ledger Entries"](../page/25.md) (source table)
- [Page 5939 "Serv. Apply Customer Entries"](../page/5939.md) (source table)
- [Page 61 "Applied Customer Entries"](../page/61.md) (source table)
- [Page 9106 "Customer Ledger Entry FactBox"](../page/9106.md) (source table)
- [Codeunit 103 "Cust. Entry-Edit"](../codeunit/103.md) (codeunit runs on it)
- [Codeunit 1213 "Pmt. Export Cust. Ledger Check"](../codeunit/1213.md) (codeunit runs on it)
- [Codeunit 226 "CustEntry-Apply Posted Entries"](../codeunit/226.md) (codeunit runs on it)

## Extended by

- [Table extension 1952 "CustomerLedgerEntryLPP"](../tableextension/1952.md)
- [Table extension 30201 "Shpfy Cust. Ledger Entry"](../tableextension/30201.md)
- [Table extension 8003 "Cust. Ledger Entry"](../tableextension/8003.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 103 "Cust. Entry-Edit"](../codeunit/103.md) (1 call: `SetAmountToApply → (object)`)
- [Codeunit 408 "DimensionManagement"](../codeunit/408.md) (1 call: `ShowDimensions → ShowDimensionSet`)
- [Codeunit 700 "Page Management"](../codeunit/700.md) (1 call: `ShowDoc → PageRun`)
- [Codeunit 703 "Find Record Management"](../codeunit/703.md) (1 call: `GetLastEntryNo → GetLastEntryIntFieldValue`)
- [Codeunit 710 "Math"](../codeunit/710.md) (1 call: `AreOppositeSign → Sign`)
- [Page 438 "Issued Reminder"](../page/438.md) (1 call: `ShowDoc → (object)`)
- [Page 450 "Issued Finance Charge Memo"](../page/450.md) (1 call: `ShowDoc → (object)`)

## Recent changes

- 2026-09-14 [#10840 Bugs/625412 Wrong posted G/L Entries and VAT Entries using Cash Basis Unrealized VAT from a partial Credit Memo if we mix VAT types and use only part of the amount in the Mexican version.](../../changes/bcapps/10840.md) (main, BC30, fix)
- 2026-07-20 [#9089 Merge-ES-Excluded-from-Calculation-to-W1](../../changes/bcapps/9089.md) (main, BC30, feature)

## Across versions

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

## Countries that replace it

[AU](../../localizations/au.md), [CA](../../localizations/ca.md), [CH](../../localizations/ch.md), [ES](../../localizations/es.md), [FI](../../localizations/fi.md), [IS](../../localizations/is.md), [IT](../../localizations/it.md), [MX](../../localizations/mx.md), [NL](../../localizations/nl.md), [NZ](../../localizations/nz.md), [RU](../../localizations/ru.md), [US](../../localizations/us.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: "table", object_name: "Cust. Ledger Entry")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
