FlowFields Without the N+1
Credit control starts every morning from the balance digest: one line per customer of the region — number, name, and what they currently owe. The lines come out right, but the DBA's trace glows: inside the loop, one extra little SELECT fires against the ledger for every single customer. Forty customers, forty-one statements — the textbook N+1, born the moment a per-row lookup lands inside a loop.
Your job: the same lines, a handful of statements.
Requirements
Create a codeunit named "Customer Balance Digest" with one public procedure:
procedure BuildDigest(var Customer: Record Customer): List of [Text]The procedure receives a Customer record whose filters the caller has already set, and nothing has been read into it yet. Do the pass inside those filters.
Rules:
- Return one line per matching customer, in ascending
"No."order: the customer's"No.",Nameand balance joined by|(pipe), no extra spaces — e.g.TRYAL-1|Alice Smith|250.75.
Solve it with Pro
You’re reading the opening of the statement. Pro unlocks the whole problem:
- The full statement
- Starter code in the browser editor
- 7 grading tests, run on Business Central 28.5
- 3 hints
- The reference solution
Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.
Already on Pro? Sign in