Skip to content

Fix Aged Accounts Receivable (Report 120) performance on large ledger history#9195

Open
ventselartur wants to merge 1 commit into
mainfrom
bugfix/640854-aged-accounts-receivable-perf
Open

Fix Aged Accounts Receivable (Report 120) performance on large ledger history#9195
ventselartur wants to merge 1 commit into
mainfrom
bugfix/640854-aged-accounts-receivable-perf

Conversation

@ventselartur

@ventselartur ventselartur commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why

The standard Aged Accounts Receivable report (Report 120, Base Application) does not complete on databases holding 2-3 years of Customer Ledger history — the UI hangs on "Working on it… Rows generated". A CPU profile (~334s, ~99% in SQL) traced ~22-35% of the time to the per-row Detailed Cust. Ledg. Entry loop, which issued a full-record FindSet for every temporary ledger entry. This N+1 pattern scales with total Detailed Cust. Ledg. Entry history rather than with the size of the open receivables population, even though aging is a point-in-time snapshot anchored to a single "Aged As Of" date.

Summary

  • Added SetLoadFields on the Detailed Cust. Ledg. Entry loop in Report 120 so only the four columns the loop consumes (Entry Type, Posting Date, Amount, Amount (LCY)) are read, cutting per-row SQL cost — Cust. Ledger Entry No. is only a filter and needs no load.
  • Propagated the identical change from the W1 base layer to the ES and NA base layers via Miapp to keep localizations in sync.

Work item: AB#640854

… history

Report 120 issued a Detailed Cust. Ledg. Entry FindSet per temp ledger
entry with full records, an N+1 pattern that scaled with total Detailed
Cust. Ledg. Entry history and effectively hung on 2-3 years of data.

Add SetLoadFields to the Detailed Cust. Ledg. Entry loop so only the four
columns consumed by the loop are read, reducing per-row SQL cost.
Propagated from W1 to the ES and NA base layers via Miapp.

Work item: AB#640854

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ventselartur ventselartur requested a review from a team July 7, 2026 18:43
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Agent 1 0 1 1 0

Totals: 0 knowledge-backed · 1 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant