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

#14138 [MAIN] Fix undo of final subcontracting operation after earlier operation undo (Bug 653934)

Fixed a bug where undoing the final subcontracting operation on a posted purchase receipt failed with an "Applies-to Entry must have a value" error when an earlier operation had already been undone. The capacity ledger entry lookup is now scoped to the receipt line's routing details and excludes reversal entries.

Pull request · merged into main (BC30) on 2026-11-20 by alexei-dobriansky · 2 files (+199 -1), 1 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Capacity ledger entry lookup now filters by receipt line’s Routing No., Routing Reference No., and Operation No. to find the correct entry
  • Reversal entries are excluded from the lookup to prevent selecting the wrong register after an earlier undo
  • Output item ledger entries are only collected when the original capacity entry is the last output operation
  • Undoing intermediate operations now reverses only their capacity using their own time values
  • New test cases added to verify correct undo behavior for multiple subcontracting operations on the same receipt
  • Behaviour changes for users or extensions.

AL objects touched

Also merged into

  • #14393 into releases/29.x on 2026-12-02

Context

  • Work items: AB#653934
  • Labels: AL: Apps (W1), Team: SCM
  • Systems: purchasing

No source states these links: they share an object, a model read them, or a person found the same subject.

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