BC Friday Tips #35 Item Journal Posting and Warehouse Entries
Item journal posting in AL has two codeunits: Codeunit 22 posts individual lines while Codeunit 23 posts entire batches. When warehouse entries are needed, use Codeunit 23 even for single lines, as Codeunit 22 silently fails to create warehouse entries without throwing an error.
Read it hereOpen in Claudehttps-thatnavguy-com-blog-2025-bc-friday-tips-35-item-journal-posting-and-warehouse-entries--e451824ad4.md

post That NAV Guy
"Posting with Codeunit 22 doesn't create warehouse entries. It won't even throw an error."
Key points
- Codeunit 22 posts one journal line at a time
- Codeunit 23 posts all lines in a batch
- Codeunit 22 does not create warehouse entries and won’t error
- Always use Codeunit 23 when warehouse entries are involved
Quotes
- “Posting with Codeunit 22 doesn’t create warehouse entries. It won’t even throw an error.” (Developers need to know that Codeunit 22 silently fails to create warehouse entries, which can lead to missed data without any error indication.)
- “Always use Codeunit 23 “Item Jnl.-Post Batch” when warehouse entries are involved. Even if you’re only posting one line.” (This is the critical best practice that prevents data integrity issues when posting to warehouses.)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Business Central 2026 release wave 1 (BC28): Post purchase invoices for drop shipments independently of related sales invoices — possibly related: both name Codeunit 22 “Item Jnl.-Post Line”
- Design details - Cost adjustment — possibly related: names Codeunit 22 “Item Jnl.-Post Line”
- Design details - Item tracking posting structure — possibly related: names Codeunit 22 “Item Jnl.-Post Line”
- Dynamics 365 Business Central: How to check whether the current page/report is standard or customized — possibly related: both name Codeunit 23 “Item Jnl.-Post Batch”
- New Application Ideas of Dynamics 365 Business Central (2025 NOV) — possibly related: both name Codeunit 22 “Item Jnl.-Post Line”
Heads up
- gotcha: “Posting with Codeunit 22 doesn’t create warehouse entries. It won’t even throw an error.” (about codeunit Item Jnl.-Post Line)
- warning: “Always use Codeunit 23 “Item Jnl.-Post Batch” when warehouse entries are involved.” (about codeunit Item Jnl.-Post Line, codeunit Item Jnl.-Post Batch)
Context
- Features: Item Journal Posting, Warehouse Entries
Source: That NAV Guy, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.