---
id: change/bcapps/9005
type: change
title: "#9005 (Bug 641089) Guard Item Ledger/Value Entry No. allocation in Item Jnl.-Post Line with CommitBehavior::Ignore"
summary: 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.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit item jnl.-post line
system: inventory
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:13:20.864Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: c8e36d6d4df48750cfcf93c3f0530e5f33eb36c9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9005
    title: "microsoft/BCApps#9005: (Bug 641089) Guard Item Ledger/Value Entry No. allocation in Item Jnl.-Post Line with CommitBehavior::Ignore"
    date: "2026-07-09"
    commit: c8e36d6d4df48750cfcf93c3f0530e5f33eb36c9
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/22
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9005
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9005
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-09T14:04:10Z"
author: alexei-dobriansky
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 7
  additions: 255
  deletions: 3
  al: 6
apps:
  - Base Application
objects_touched:
  - key: codeunit/22
    page: codeunit/22
    type: codeunit
    id: 22
    name: Item Jnl.-Post Line
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/APAC/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al
    status: modified
    reason: not-in-snapshot
  - path: src/Layers/CH/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al
    status: modified
    reason: not-in-snapshot
  - path: src/Layers/ES/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al
    status: modified
    reason: not-in-snapshot
  - path: src/Layers/IT/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 641089
systems:
  - inventory
quote: null
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #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](https://github.com/microsoft/BCApps/pull/9005) · 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"](../../objects/codeunit/22.md), 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).
