Partial Record vs NST Caching : the strange case of Calculate Low Level Code
Partial record optimization using SetLoadFields can unexpectedly cause performance regressions when combined with NST caching in Business Central. The post demonstrates how adding SetLoadFields to the Production BOM Version record in the Calculate Low Level Code report creates multiple SQL queries instead of leveraging the platform's caching mechanism, resulting in thousands of redundant database calls in large datasets.

post Dynamics 365 Business Central tales, myths, legends. And something serious.
"When using partial records, the caching mechanism is somewhat hardly invoked (or not working at all)."
Key points
- Partial records loaded with SetLoadFields are not cached by the NST, while a full record read via FindLast is cached and reused.
- In Calculate Low Level Code, about 10,000 items without a Production BOM each trigger the same Production BOM Version lookup. With SetLoadFields this produced over 10,000 identical SQL statements instead of one.
- The regression appeared after an upgrade from 23.6 to 27.6 because a SetLoadFields call was added. Adding it in 23.6 shows the same lack of caching, so it is current platform design.
- Guidance cited from Microsoft’s platform team: use partial records for tables with many columns, a low share of columns retrieved, and large recordsets. Single-record reads gain less.
- SetLoadFields usage in the IT Base Application grew from 410 in 23.6 to 943 in 27.6, so similar cases may exist elsewhere.
Quotes
- “When using partial records, the caching mechanism is somewhat hardly invoked (or not working at all).” (Identifies the core issue that SetLoadFields bypasses NST caching, which is critical for understanding when partial records hurt performance)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- report 152 “Calculate Low Level Code”
- codeunit 3687 “Low-Level Code Calculator”
- codeunit “Version Management”
- table 99000779 “Production BOM Version”
- table 27 “Item”
Not found in BC28-30: codeunit “Version Management”.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- BC Friday Tips #69 Item Blocked Fields — possibly related: both name Table 27 “Item”
- BC Friday Tips #84 Why Is Your Item Missing from the Sales Line Lookup? — possibly related: both name Table 27 “Item”
- Business Central 2025 wave 2 (BC27): App version in “Copy error details”/”Share details via” — possibly related: both name Table 27 “Item”
- Dynamics 365 Business Central: compressing API responses at max. — possibly related: both name Table 27 “Item”
- Dynamics 365 Business Central: How to add Filter by item attributes to the Item Ledger Entries page — possibly related: both name Table 27 “Item”
- Dynamics 365 Business Central: How to bulk import marketing text to items – Customization — possibly related: both name Table 27 “Item”
- Dynamics 365 Business Central: How to change Zero (0) of Flowfield field to Dash (-) on the page — possibly related: both name Table 27 “Item”
- Dynamics 365 Business Central: Why are the newly added fields in drop-down not displayed? (e.g., adding item Search Description to DropDown fieldgroup) — possibly related: both name Table 27 “Item”
- Introducing: AI-Powered Analysis with Copilot (2024 release wave 1) — possibly related: both name Table 27 “Item”
- Introducing: Sales Lines Suggestions with Copilot ( 2024 release wave 1) — possibly related: both name Table 27 “Item”
Heads up
- gotcha: “When using partial records, the caching mechanism is somewhat… hardly invoked (or not working at all).” (about version 27, version 28)
- gotcha: “SetLoadFields do its job: it gets just 10 column out of 14 BUT it does NOT trigger NST to cache values in this scenario.” (about codeunit Low-Level Code Calculator, report Calculate Low Level Code, version 27, version 28)
Context
- Features: SetLoadFields, Partial Records, NST Caching, Query Optimization, Performance Profiling, Telemetry Logging
- Versions: 23.6, 27.6, 28.4, 29, 2026 Wave 2
Source: Duilio Tacconi, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.