code change · fixInventoryofficial - Microsoftreviewed - checked by Opus

#9005 (Bug 641089) Guard Item Ledger/Value Entry No. allocation in Item Jnl.-Post Line with CommitBehavior::Ignore

Item journal posting now prevents duplicate-key errors in concurrent scenarios by wrapping split posting in a commit-behavior guard frame, with an event for callers that need commits honored.

Pull request · merged into main (BC30) on 2026-07-09 by alexei-dobriansky · 7 files (+255 -3), 6 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Split posting in Item Jnl.-Post Line now runs inside a CommitBehavior::Ignore frame, so Item Ledger and Value Entry numbers stay protected
  • New OnSetCommitBehavior event lets callers opt out and get the old commit behavior back
  • Follows the existing guard pattern in Gen. Jnl.-Post Line
  • Applied to the W1, APAC, CH, ES, IT and RU layers
  • Two tests check that commits are suppressed and that the opt-out works
  • Behaviour changes for users or extensions.

AL objects touched

  • Codeunit 22 “Item Jnl.-Post Line”, Base Application: modified
  • src/Layers/APAC/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al: modified, not in the BC30 snapshot
  • src/Layers/CH/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al: modified, not in the BC30 snapshot
  • src/Layers/ES/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al: modified, not in the BC30 snapshot
  • src/Layers/IT/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al: modified, not in the BC30 snapshot

Context

  • Work items: AB#641089
  • Labels: Team: SCM
  • Systems: inventory

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