#13262 [Financial Reports] Trial Balance by Period (Excel) should use a query-based approach rather than loop and CalcFields
Trial Balance by Period (Excel) (report 4408) now gets amounts from a new query, EXR Trial Bal by Period, grouped by global dimensions instead of looping with CalcFields. This cuts SQL calls to two per account and period, no matter how many dimension values exist, while producing the same dataset rows.
- 4files
- 3AL files
- 3objects
Pull request · merged into main (BC30) on 2026-10-27 by dcenic · 4 files (+408 -38), 3 AL · performance · tier official · reviewed (checked by Opus)
What changed
- Replaced inefficient loop-and-CalcFields pattern with a single query that groups G/L entries by dimension values
- Reduces SQL calls from approximately 4 × accounts × periods × (1 + D1 + D2 + D1·D2) to just 2 × accounts × periods
- Query runs twice per account per period: once for net change and once for balance
- Dimension values loaded once in OnPreReport instead of repeatedly queried
- Dataset generation moved from database to memory buffer, maintaining same output format with and without zero-value filtering
AL objects touched
- Query 4408 “EXR Trial Bal by Period”, ExcelReports: added
- Report 4408 “EXR Trial Bal by Period Excel”, ExcelReports: modified
- Permission set 4401 “Excel Reports - Objects”, ExcelReports: modified
Also merged into
- #13316 into
releases/29.xon 2026-10-28
Context
- Work items: AB#656773
- Labels: AL: Apps (W1), Team: Finance
- Systems: finance, reporting
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Trial Balance by Period (Report) — possibly related: Documents Trial Balance by Period report that this change optimizes with query-based approach. (model-linked)
Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).