Skip to content
D365 Reference

PurchTable

worksheet header

Purchase 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

KeyFieldEDTDescriptionTypeLengthFlags
KeyPurchIdPurchIdThe purchase order number — the natural keystring20
OrderAccountVendAccountVendor account the order is placed withstring20
PurchStatusOrder status across its life cycleenum
PurchNameFree-text order descriptionstring60
DeliveryDateRequested delivery date; the primary analysis date for the headerdate
InvoiceAccountVendAccountVendor account the invoice is settled against when it differs from the ordering accountstring20
DocumentStateApproval state of the order under change management (draft, in review, approved, confirmed)enum
DocumentStatusThe furthest document posted for the order — none, purchase order, receipts list, packing slip, or invoiceenum
PurchaseTypeKind of order — purchase, returned order, or journalenum
AccountingDateDate the order posts to the ledger underdate
ConfirmedDlvConfirmed delivery date; unset rows carry the 1900-01-01 sentineldate
CurrencyCodeOrder currencystring3
InventSiteIdInventSiteIdDefault receiving site for the orderstring10
InventLocationIdInventLocationIdDefault receiving warehouse for the orderstring10
DlvModeMode of deliverystring10
DlvTermDelivery termsstring10
PaymentTerms-of-payment code for the orderstring10
PaymModeMethod of paymentstring10
CashDiscCash discount codestring10
CashDiscPercentCash discount percentagereal
DiscPercentTotal discount percentage applied to the orderreal
PurchPoolIdPurchase pool the order is grouped under for follow-upstring10
VendGroupVendGroupIdVendor group, defaulted from the ordering vendorstring10
DefaultDimensionRecIdRecId of the order's default financial-dimension value set in DimensionAttributeValueSetint64
VendorRefThe vendor's own reference for the orderstring20
RequesterRecIdRecId of the worker who requested the orderint64
DeliveryNameName at the delivery addressstring60
DeliveryPostalAddressRecIdRecId of the delivery postal address in LogisticsPostalAddressint64
ProjIdProject the order is attached tostring20
ItemBuyerGroupIdBuyer group responsible for the orderstring10

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

  • PurchTablePurchLineheader line · 1:N
    ON purchtable.purchid = purchline.purchid
  • PurchTableVendTableforeign key · N:1
    ON purchtable.orderaccount = vendtable.accountnum
  • VendInvoiceJourPurchTableforeign key · N:1
    ON vendinvoicejour.purchid = purchtable.purchid
  • VendPackingSlipJourPurchTableforeign key · N:1
    ON vendpackingslipjour.purchid = purchtable.purchid

Data Entities That Expose This Table