D365 Reference
PurchTable
worksheet headerPurchase order header — one row per order carrying vendor, status, and delivery date
Module: Procurement & SourcingCompany-partitioned (DataAreaId)
Header & line
PurchTable is the header for its lines in PurchLine.
Fields
30 fields · 1 key
| Key | Field | EDT | Description | Type | Length | Flags |
|---|---|---|---|---|---|---|
| Key | PurchId | PurchId | The purchase order number — the natural key | string | 20 | |
| OrderAccount | VendAccount | Vendor account the order is placed with | string | 20 | ||
| PurchStatus | Order status across its life cycle | enum | ||||
| PurchName | Free-text order description | string | 60 | |||
| DeliveryDate | Requested delivery date; the primary analysis date for the header | date | ||||
| InvoiceAccount | VendAccount | Vendor account the invoice is settled against when it differs from the ordering account | string | 20 | ||
| DocumentState | Approval state of the order under change management (draft, in review, approved, confirmed) | enum | ||||
| DocumentStatus | The furthest document posted for the order — none, purchase order, receipts list, packing slip, or invoice | enum | ||||
| PurchaseType | Kind of order — purchase, returned order, or journal | enum | ||||
| AccountingDate | Date the order posts to the ledger under | date | ||||
| ConfirmedDlv | Confirmed delivery date; unset rows carry the 1900-01-01 sentinel | date | ||||
| CurrencyCode | Order currency | string | 3 | |||
| InventSiteId | InventSiteId | Default receiving site for the order | string | 10 | ||
| InventLocationId | InventLocationId | Default receiving warehouse for the order | string | 10 | ||
| DlvMode | Mode of delivery | string | 10 | |||
| DlvTerm | Delivery terms | string | 10 | |||
| Payment | Terms-of-payment code for the order | string | 10 | |||
| PaymMode | Method of payment | string | 10 | |||
| CashDisc | Cash discount code | string | 10 | |||
| CashDiscPercent | Cash discount percentage | real | ||||
| DiscPercent | Total discount percentage applied to the order | real | ||||
| PurchPoolId | Purchase pool the order is grouped under for follow-up | string | 10 | |||
| VendGroup | VendGroupId | Vendor group, defaulted from the ordering vendor | string | 10 | ||
| DefaultDimension | RecId | RecId of the order's default financial-dimension value set in DimensionAttributeValueSet | int64 | |||
| VendorRef | The vendor's own reference for the order | string | 20 | |||
| Requester | RecId | RecId of the worker who requested the order | int64 | |||
| DeliveryName | Name at the delivery address | string | 60 | |||
| DeliveryPostalAddress | RecId | RecId of the delivery postal address in LogisticsPostalAddress | int64 | |||
| ProjId | Project the order is attached to | string | 20 | |||
| ItemBuyerGroupId | Buyer group responsible for the order | string | 10 |
Field provenance: hand-curated.
Boilerplate SQL
Starting point for reading PurchTableon 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
-- ============================================================
-- Table : PurchTable Purchase order header — one row per order carrying vendor, status, and delivery date
-- Purpose: Column-selected read of PurchTable — auto-generated from field metadata
-- Grain : One row per company (dataareaid) + PurchId
-- 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
po.purchid AS "The purchase order number — the natural key",
po.orderaccount AS "Vendor account the order is placed with",
po.purchstatus AS "Order status across its life cycle", -- enum: decode po.purchstatus via GlobalOptionsetMetadata join — see quirks guide #enums
po.purchname AS "Free-text order description",
po.deliverydate AS "Requested delivery date; the primary analysis date for the header",
po.invoiceaccount AS "Vendor account the invoice is settled against when it differs from the ordering account",
po.documentstate AS "Approval state of the order under change management (draft, in review, approved, confirmed)", -- enum: decode po.documentstate via GlobalOptionsetMetadata join — see quirks guide #enums
po.documentstatus AS "The furthest document posted for the order — none, purchase order, receipts list, packing slip, or invoice", -- enum: decode po.documentstatus via GlobalOptionsetMetadata join — see quirks guide #enums
po.purchasetype AS "Kind of order — purchase, returned order, or journal", -- enum: decode po.purchasetype via GlobalOptionsetMetadata join — see quirks guide #enums
po.accountingdate AS "Date the order posts to the ledger under",
CASE WHEN CAST(po.confirmeddlv AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(po.confirmeddlv AS DATE) END AS "Confirmed delivery date; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
po.currencycode AS "Order currency",
po.inventsiteid AS "Default receiving site for the order",
po.inventlocationid AS "Default receiving warehouse for the order",
po.dlvmode AS "Mode of delivery",
po.dlvterm AS "Delivery terms",
po.payment AS "Terms-of-payment code for the order",
po.paymmode AS "Method of payment",
po.cashdisc AS "Cash discount code",
po.cashdiscpercent AS "Cash discount percentage",
po.discpercent AS "Total discount percentage applied to the order",
po.purchpoolid AS "Purchase pool the order is grouped under for follow-up",
po.vendgroup AS "Vendor group, defaulted from the ordering vendor",
po.defaultdimension AS "RecId of the order's default financial-dimension value set in DimensionAttributeValueSet",
po.vendorref AS "The vendor's own reference for the order",
po.requester AS "RecId of the worker who requested the order",
po.deliveryname AS "Name at the delivery address",
po.deliverypostaladdress AS "RecId of the delivery postal address in LogisticsPostalAddress",
po.projid AS "Project the order is attached to",
po.itembuyergroupid AS "Buyer group responsible for the order"
FROM <catalog>.<schema>.purchtable po
WHERE
po.dataareaid = '<company>'
-- AND po.purchid = '<PurchId>'
-- AND po.deliverydate >= '<DATE_FROM>' -- yyyy-MM-dd (UTC)
-- AND po.deliverydate <= '<DATE_TO>' -- yyyy-MM-dd (UTC)
ORDER BY po.purchid;6 parameters not filled: <catalog>, <schema>, <company>, <PurchId>, <DATE_FROM>, <DATE_TO>
Relationships
1-hop neighbors — click a table to navigate there. RecId and InventDim edges are highlighted; they’re the joins newcomers most often get wrong.
Join details
ON purchtable.purchid = purchline.purchidON purchtable.orderaccount = vendtable.accountnumON vendinvoicejour.purchid = purchtable.purchidON vendpackingslipjour.purchid = purchtable.purchid