code change · performancePurchasing & Payablesofficial - Microsoftreviewed - checked by Opus

#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.

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

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).”

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).