#10063 Fix the shadowed header cache in reminder line GetCurrencyCodeFromHeader
Fixed a variable shadowing bug in GetCurrencyCodeFromHeader() on reminder and issued reminder line tables that caused the header to be re-read from the database on every single call instead of using the cache. Table 298 uses a simple deletion of the shadowing local, while table 296 adds a dedicated global to avoid breaking an existing cache contract.
- 9files
- 9AL files
- 2objects
Pull request · merged into main (BC30) on 2026-12-05 by Franco111000 (community contribution) · 9 files (+35 -38), 9 AL · fix · tier official · reviewed (checked by Opus)
What changed
- A local record shadowed the global in GetCurrencyCodeFromHeader(), so the cache check never matched and the header was read on every call
- The procedure is the AutoFormatExpression for amount fields and report columns (about 230 usages in 26 files)
- Table 298 Issued Reminder Line simply drops the shadowing local so the existing global cache works
- Table 296 Reminder Line gets a separate CurrencyCodeReminderHeader global so the shared ReminderHeader cache used by GetReminderHeader() is not affected
- Displaying a reminder with N lines no longer needs roughly 4N header reads
AL objects touched
- Table 298 “Issued Reminder Line”, Base Application: modified
- Table 296 “Reminder Line”, Base Application: modified
src/Layers/ES/BaseApp/Sales/Reminder/ReminderLine.Table.al: modified, not in the BC30 snapshot
Context
- Fixes: #8850 [Bug]: Issued/Reminder Line GetCurrencyCodeFromHeader() (closed)
- Work items: AB#656779
- Labels: ADO: Sync, From Fork, Team: Finance
- Systems: sales
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Reminder report — possibly related: touches Table 298 “Issued Reminder Line”
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).