D365 Reference
PurchTable
worksheet headerPurchase order header — one row per order carrying vendor, status, and delivery date
Module: Procurement & SourcingCompany-partitioned (DataAreaId)
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/ValidToeffectivity 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
KPI definitions
Dashboard patterns
Header & line
PurchTable is the header for its lines in PurchLine.
Fields
30 fields · 1 key
30 fields.
| 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; unset rows carry the 1900-01-01 sentinel | 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 PurchTable 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
6 parameters not filled: <catalog>, <schema>, <company>, <PurchId>, <DATE_FROM>, <DATE_TO>
-- ============================================================
-- 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
CASE WHEN CAST(po.accountingdate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(po.accountingdate AS DATE) END AS "Date the order posts to the ledger under; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
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;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
ON purchtable.purchid = purchline.purchid AND purchtable.dataareaid = purchline.dataareaidON purchtable.orderaccount = vendtable.accountnum AND purchtable.dataareaid = vendtable.dataareaidON vendinvoicejour.purchid = purchtable.purchid AND vendinvoicejour.dataareaid = purchtable.dataareaidON vendpackingslipjour.purchid = purchtable.purchid AND vendpackingslipjour.dataareaid = purchtable.dataareaid
Data Entities That Expose This Table
- PurchPurchaseOrderHeaderV2Entity — Purchase order headers — one record per order, the header-level export for procure-to-payPrimary sourcePurchaseOrderHeadersV2
- PurchPurchaseOrderLineV2Entity — Purchase order lines — one record per order line, the line-level export joined to its headerPurchaseOrderLinesV2
More Procurement & Sourcing tables
- VendGroupVendor group master — the posting, payment-term, and number-sequence defaults shared by every vendor in the group
- VendInvoiceJourPosted vendor invoice header — one row per posted AP invoice, carrying totals, due date, cash-discount terms, and the ledger voucher
- VendInvoiceTransPosted vendor invoice line — one row per invoiced line with quantity, price, and the links back to its purchase order and inventory movements
- VendPackingSlipJourPosted product receipt (packing slip) header — one row per receipt posted against a purchase order, the record of when goods physically arrived
- VendTableVendor master — one row per vendor account, with the RecId link to its global-address-book party
- PurchLinePurchase order line — one row per order line; the core buy-side transaction, joined to its header by PurchId