community postWarehousecommunity - not Microsoftreviewed - checked by Opus

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.

post That NAV Guy

Teddy Herryanto · 2025-06-13 · 115 words · about 1 min

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

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.