code change · fixInventoryofficial - Microsoftreviewed - checked by Opus

#9531 [Master]- Report 152 "Calculate Low Level Code" terminates with error: "Cannot add instance as another with key %1 has already been added." after upgrade to v28.1

Report 152 now correctly handles items with multiple SKUs sharing the same Production BOM by replacing enumeration-based lookup with a direct dictionary key search in the BOM tree node logic.

Pull request · merged into main (BC30) on 2026-07-17 by DhavalMore88 (community contribution) · 4 files (+72 -8), 3 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Fixed a regression where Report 152 crashed when an item and its SKUs referenced the same Production BOM
  • Changed IsChild procedure from enumeration-based to O(1) key lookup to avoid leaving the shared enumerator in an incorrect state
  • Added regression test for items with multiple SKUs sharing one Production BOM
  • The issue occurred because exiting mid-enumeration left the shared enumerator stranded, preventing duplicate detection
  • Behaviour changes for users or extensions.

AL objects touched

Context

  • Work items: AB#642311
  • Labels: ADO: Sync, From Fork, Team: SCM
  • Systems: inventory
  • From the description: “Replaced the enumeration in IsChild with a direct O(1) key lookup.”

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