Skip to content

Initialize NoOfDetailedCustomerEntries in OnFindRecord - Fixes #13621 - #14830

Open
Joris Poppe (jorispoppe) wants to merge 1 commit into
microsoft:mainfrom
jorispoppe:jorispoppe-patch-13621
Open

Joris Poppe (jorispoppe) wants to merge 1 commit into
microsoft:mainfrom
jorispoppe:jorispoppe-patch-13621

Conversation

@jorispoppe

Copy link
Copy Markdown

What & why

Customer Ledger Entry Factbox - Detailed Ledger Entries is not updated when linked entry is cleared

Add the factbox on a cardpage as a part
Select a value of the Customer Ledger Entry on your page
Factbox is filled with data
Clear the Customer Ledger Entry field
All data on the Factbox is cleared except for the Detailed Ledger Entry count

Linked work

Fixes #13621

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

  • No tests added

Risk & compatibility

None

@jorispoppe
Joris Poppe (jorispoppe) requested a review from a team as a code owner December 2, 2026 13:40
@github-actions github-actions Bot added the From Fork Pull request is coming from a fork label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Issue #13621 is not valid. Please make sure you link an issue that exists, is open and is approved.

@github-actions github-actions Bot added the Team: Finance GitHub request for Finance area label Dec 2, 2026
@github-actions github-actions Bot added the needs-approval Workflow runs require maintainer approval to start label Dec 2, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

Resets the Detailed Ledger Entries count when the Customer Ledger Entry FactBox searches for a record. This prevents a count from the previous entry remaining visible after the parent page clears its linked entry.

The reset runs before Rec.Find(Which), so the count stays zero when no entry is found. When an entry is found, OnAfterGetRecord recalculates the count through the unchanged CalcNoOfRecords routine. This follows the existing reset pattern for the other counters without changing their calculations or drilldowns.

Problem-solution fit

Fit: Strong

The missing reset directly explains the stale count after the linked entry is cleared. Adding it to the existing initialization block addresses that scenario without changing normal entry selection.

Suggestions

None.

Risk assessment and necessity

Risk: Low. CustomerLedgerEntryFactBox.Page.al changes only a page-local display counter. Stored ledger entries, posting, filters, public interfaces, and events are unchanged, and there are no extra queries or upgrade steps. Static review only; builds and runtime tests were not run. The one-line reset does not warrant a separate test requirement.

Necessity: Without this change, clearing the linked entry leaves a misleading count beside otherwise cleared fields until a valid entry is loaded. The fix is narrowly scoped to that display defect.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=14830 round=1 by=alexei-dobriansky at=2026-12-02T14:22:17.8640382Z lastSha=0864781ad9a6f74efb90e13c7cf9d3a762c36435 reviewKey=63ff32eacccfa6fa0b7d4e14b911663c9a77c5d78ffeb9644349c81519297dd7 suggestions=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added reset correctly clears the Detailed Ledger Entries count when no customer ledger entry is found, consistent with the adjacent counters. Existing-record counts continue to be recalculated in OnAfterGetRecord. No blocking findings.

This branch was previously deployed

1 inactive deployment
triage — 0864781a Deployed Dec 2, 2026 by jorispoppe via Classify team ownership #12732
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Customer Ledger Entry Factbox - Detailed Ledger Entries is not updated when linked entry is cleared

3 participants