#12607 [BE] Improve Purchase Ledger report performance
The Belgian Purchase Ledger report now uses a single left-joined query with temporary buffering instead of per-entry lookups to reduce database calls and improve performance.
- 4files
- 3AL files
- 3objects
Pull request · merged into main (BC30) on 2026-10-22 by dcenic · 4 files (+275 -3), 3 AL · performance · tier official · reviewed (checked by Opus)
What changed
- Replaces multiple per-entry VAT link queries and VAT Entry.Get calls with one left-joined query per journal template and period
- Introduces an internal temporary buffer table and query to aggregate results
- Filters on G/L entry dates rather than VAT entry dates to avoid filtering assumptions
- Uses SetLoadFields and SetAutoCalcFields optimizations for supporting lookups
- Maintains existing error handling and currency display behavior
AL objects touched
- Table 11302 “Purch. Ledger VAT Buffer”, Base Application (BE layer): added
- Query 11302 “Purch. Ledger VAT Detail”, Base Application (BE layer): added
- Report 11301 “Purchase Ledger”, Base Application (BE layer): modified
Context
- Work items: AB#649462
- Labels: Ownership: Manual, Team: Finance
- Systems: purchasing
- From the description: “Reduce database overhead in the Belgian Purchase Ledger report (11301).”
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Query object — possibly related: Documents query objects that retrieve and display data, improving performance through proper design. (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).