#10254 Fix 644744: Undo subcontracting receipt keys Item Entry Relation with Capacity Ledger Entry No.
Subcontracting purchase receipt undo now uses the correct Output Item Ledger Entry instead of the Capacity Ledger Entry No. when recording item entry relations, preventing data corruption and duplicate key errors for tracked items.
- 3files
- 1AL files
- 1objects
Pull request · merged into main (BC30) on 2026-08-20 by alexei-dobriansky · 3 files (+198 -6), 1 AL · fix · tier official · reviewed (checked by Opus)
What changed
- Undo of tracked subcontracting receipts now keys item entry relations from the actual posted Output Item Ledger Entry, not the capacity entry number
- Fixes silent corruption and duplicate key errors in Item Entry Relation table for multi-output or tracked subcontracting undo
- Normal items and single-line capacity-only undo paths remain unaffected
- New tests verify the fix handles tracked undo correctly and guards against non-last-operation scenarios
- Previously disabled test for undo with lot tracking re-enabled
- Behaviour changes for users or extensions.
AL objects touched
- Codeunit 5817 “Undo Posting Management”, Base Application: modified
Context
- Work items: AB#644744
- Labels: AL: Apps (W1), Subcontracting, Team: SCM
- Systems: inventory
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Assign item charges to subcontracting receipts — possibly related: Assign item charges to subcontracting receipts explains how costs relate to subcontracting operations this fix addresses. (model-linked)
- Design details - Item tracking posting structure — possibly related: Design details of Item tracking posting structure documents Item Entry Relation table structure this fix modifies. (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).