Skip to content
D365 Reference

InventBatch

worksheet header

Batch master — one row per item and batch number, carrying expiry and manufacturing dates plus vendor batch details; the record behind the inventBatchId dimension

Module: InventoryCompany-partitioned (DataAreaId)
Notes

Keyed by itemId + inventBatchId (batch numbers are unique per item, not global). Pds* fields belong to Process manufacturing and are empty unless that module is used.

What the badges mean
main
Table group: how F&O categorizes the table's role — main entity, group/header, transaction, worksheet header, worksheet line, reference, parameter, or framework.
Shared across companies
The table carries no DataAreaId— rows aren’t partitioned per company, so a query never needs (and can’t use) a company filter here (see the quirks guide).
Date-effective
The table carries a ValidFrom/ValidTo effectivity window — a join without a date filter multiplies every key by its history (see the quirks guide).
In field listings, K marks a key field.
Used in the library
Dashboard patterns

Fields

14 fields · 2 key

14 fields.

Table fields: key flag, field name, extended data type, description, data type, length, and quirk flags. 14 fields.
KeyFieldEDTDescriptionTypeLengthFlags
KeyinventBatchIdInventBatchIdThe batch number — unique within the item, referenced by InventDim.inventBatchIdstring
KeyitemIdItemIdItem the batch belongs to — batch numbers are scoped to an item, so joins need both columnsstring
descriptionFree-text description of the batchstring
expDateExpiration date of the batch; unset rows carry the 1900-01-01 sentineldate
prodDateManufacturing date of the batch; unset rows carry the 1900-01-01 sentineldate
PdsBestBeforeDateBest-before date (process manufacturing); unset rows carry the 1900-01-01 sentineldate
PdsShelfAdviceDateShelf-advice date (process manufacturing); unset rows carry the 1900-01-01 sentineldate
PdsDispositionCodeBatch disposition code controlling whether the batch is usable, blocked, or restrictedstring
PdsVendBatchIdThe vendor's own batch number for a purchased batchstring
PdsVendBatchDateVendor batch (manufacturing) date; unset rows carry the 1900-01-01 sentineldate
PdsVendExpiryDateVendor expiry date; unset rows carry the 1900-01-01 sentineldate
PdsCountryOfOrigin1Country of origin recorded for the batchstring
PdsFinishedGoodsDateTestedDate the finished-goods batch was tested; unset rows carry the 1900-01-01 sentineldate
ManufacturerIdRecIdRecId of the manufacturer's global-address-book party in DirPartyTableint64

Field provenance: hand-curated.

Boilerplate SQL

Starting point for reading InventBatch on Databricks — enums are decoded, 1900-01-01 dates are wrapped to NULL, and the DataAreaId anchor is in place. Set your Unity Catalog location, company, and filter values below; they’re substituted into the SQL and the copy button.

Query parameters

4 parameters not filled: <catalog>, <schema>, <company>, <ItemId>

-- ============================================================
-- Table  : InventBatch Batch master — one row per item and batch number, carrying expiry and manufacturing dates plus vendor batch details; the record behind the inventBatchId dimension
-- Purpose: Column-selected read of InventBatch — auto-generated from field metadata
-- Grain  : One row per company (dataareaid) + inventBatchId + itemId
-- Notes  : Auto-generated skeleton for Synapse Link / Fabric Link-landed F&O data (lowercase column names). Enums decoded inline where verified; datetimes stored in UTC; 1900-01-01 dates are sentinels mapped to NULL. System/audit columns omitted — see the quirks guide.
-- ============================================================
SELECT
  i.inventbatchid AS "The batch number — unique within the item, referenced by InventDim.inventBatchId",
  i.itemid AS "Item the batch belongs to — batch numbers are scoped to an item, so joins need both columns",
  i.description AS "Free-text description of the batch",
  CASE WHEN CAST(i.expdate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.expdate AS DATE) END AS "Expiration date of the batch; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  CASE WHEN CAST(i.proddate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.proddate AS DATE) END AS "Manufacturing date of the batch; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  CASE WHEN CAST(i.pdsbestbeforedate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsbestbeforedate AS DATE) END AS "Best-before date (process manufacturing); unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  CASE WHEN CAST(i.pdsshelfadvicedate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsshelfadvicedate AS DATE) END AS "Shelf-advice date (process manufacturing); unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  i.pdsdispositioncode AS "Batch disposition code controlling whether the batch is usable, blocked, or restricted",
  i.pdsvendbatchid AS "The vendor's own batch number for a purchased batch",
  CASE WHEN CAST(i.pdsvendbatchdate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsvendbatchdate AS DATE) END AS "Vendor batch (manufacturing) date; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  CASE WHEN CAST(i.pdsvendexpirydate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsvendexpirydate AS DATE) END AS "Vendor expiry date; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  i.pdscountryoforigin1 AS "Country of origin recorded for the batch",
  CASE WHEN CAST(i.pdsfinishedgoodsdatetested AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsfinishedgoodsdatetested AS DATE) END AS "Date the finished-goods batch was tested; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  i.manufacturerid AS "RecId of the manufacturer's global-address-book party in DirPartyTable"
FROM <catalog>.<schema>.inventbatch i
-- Resolve DirPartyTable (via ManufacturerId): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.dirpartytable dir ON dir.recid = i.manufacturerid
WHERE
  i.dataareaid = '<company>'
  -- AND i.itemid = '<ItemId>'
ORDER BY i.inventbatchid;

Verified September 2026

Relationships

Diagram of 1-hop neighbors — join details below. RecId and InventDim edges are highlighted; they’re the joins newcomers most often get wrong.

Join details

  • InventBatchInventTableforeign key · N:1
    ON inventbatch.itemid = inventtable.itemid AND inventbatch.dataareaid = inventtable.dataareaid
  • InventBatchDirPartyTableRecId ref · N:1
    ON inventbatch.manufacturerid = dirpartytable.recid
  • InventDimInventBatchforeign key · N:1
    ON inventdim.inventbatchid = inventbatch.inventbatchid AND inventdim.dataareaid = inventbatch.dataareaid

Data Entities That Expose This Table

No data-entity mappings populated for this table yet.

Browse more inventory tables

More Inventory tables

Maintained by Summit Analytics, a supply chain analytics practice. The tools and references are free — the consulting is selective.

Part of the Summit Analytics reference library.

Work with the practice

Not affiliated with or endorsed by Microsoft. Microsoft, Dynamics 365, and Microsoft Fabric are trademarks of the Microsoft group of companies.