Skip to content
D365 Reference

PurchLine

worksheet line

Purchase order line — one row per order line; the core buy-side transaction, joined to its header by PurchId

Module: Procurement & SourcingCompany-partitioned (DataAreaId)Header: PurchTable

Header & line

PurchLine lines join back to their header PurchTable — and the DataAreaId — so a line never fans out across companies.

Fields

22 fields · 2 key

KeyFieldEDTDescriptionTypeLengthFlags
KeyPurchIdPurchIdThe purchase order this line belongs tostring20
KeyLineNumberLineNumberLine number within the order — a 64-bit sequence, unlike the decimal LineNum on sales linesint64
ItemIdItemIdItem ordered on the linestring20
InventDimIdInventDimIdInventory-dimension combination the line receives into; join to InventDim to resolve site / warehousestring25
NameLine descriptionstring60
PurchQtyQuantity ordered in the purchase unitreal
QtyOrderedQuantity ordered restated in the inventory unitreal
PurchUnitPurchase unit of measurestring10
PurchPriceUnit price in the order currencyreal
PriceUnitNumber of units the price applies toreal
LineDiscLine discount amount per price unitreal
LineAmountNet line amount in the order currencyreal
CurrencyCodeOrder currency the line prices instring3
PurchStatusLine status — how far the line has progressed through receipt and invoicingenum
DeliveryDateRequested delivery date; the primary analysis date for the linedate
ConfirmedDlvConfirmed delivery date; unset rows carry the 1900-01-01 sentineldate
VendAccountVendAccountVendor account, defaulted from the order headerstring20
RemainPurchPhysicalQuantity still to be received (the deliver remainder), in the purchase unitreal
RemainPurchFinancialQuantity still to be invoiced (the invoice remainder)real
PurchReceivedNowQuantity staged to receive on the next receipt postingreal
DefaultDimensionRecIdRecId of the line's default financial-dimension value set in DimensionAttributeValueSetint64
ProjIdProject the line is attached tostring20

Field provenance: hand-curated.

Boilerplate SQL

Starting point for reading PurchLineon 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  : PurchLine Purchase order line — one row per order line; the core buy-side transaction, joined to its header by PurchId
-- Purpose: Column-selected read of PurchLine — auto-generated from field metadata
-- Grain  : One row per company (dataareaid) + PurchId + LineNumber
-- 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
  pl.purchid AS "The purchase order this line belongs to",
  pl.linenumber AS "Line number within the order — a 64-bit sequence, unlike the decimal LineNum on sales lines",
  pl.itemid AS "Item ordered on the line",
  pl.inventdimid AS "Inventory-dimension combination the line receives into; join to InventDim to resolve site / warehouse",
  pl.name AS "Line description",
  pl.purchqty AS "Quantity ordered in the purchase unit",
  pl.qtyordered AS "Quantity ordered restated in the inventory unit",
  pl.purchunit AS "Purchase unit of measure",
  pl.purchprice AS "Unit price in the order currency",
  pl.priceunit AS "Number of units the price applies to",
  pl.linedisc AS "Line discount amount per price unit",
  pl.lineamount AS "Net line amount in the order currency",
  pl.currencycode AS "Order currency the line prices in",
  pl.purchstatus AS "Line status — how far the line has progressed through receipt and invoicing",  -- enum: decode pl.purchstatus via GlobalOptionsetMetadata join — see quirks guide #enums
  pl.deliverydate AS "Requested delivery date; the primary analysis date for the line",
  CASE WHEN CAST(pl.confirmeddlv AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(pl.confirmeddlv AS DATE) END AS "Confirmed delivery date; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  pl.vendaccount AS "Vendor account, defaulted from the order header",
  pl.remainpurchphysical AS "Quantity still to be received (the deliver remainder), in the purchase unit",
  pl.remainpurchfinancial AS "Quantity still to be invoiced (the invoice remainder)",
  pl.purchreceivednow AS "Quantity staged to receive on the next receipt posting",
  pl.defaultdimension AS "RecId of the line's default financial-dimension value set in DimensionAttributeValueSet",
  pl.projid AS "Project the line is attached to"
FROM <catalog>.<schema>.purchline pl
-- Dimension expansion: uncomment to resolve site / warehouse / location / batch
-- LEFT JOIN <catalog>.<schema>.inventdim id ON id.inventdimid = pl.inventdimid AND id.dataareaid = pl.dataareaid
WHERE
  pl.dataareaid = '<company>'
  -- AND pl.purchid = '<PurchId>'
  -- AND pl.deliverydate >= '<DATE_FROM>'  -- yyyy-MM-dd (UTC)
  -- AND pl.deliverydate <= '<DATE_TO>'  -- yyyy-MM-dd (UTC)
ORDER BY pl.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
  • PurchLineInventTableforeign key · N:1
    ON purchline.itemid = inventtable.itemid
  • PurchLineInventDimInventDim · N:1
    ON purchline.inventdimid = inventdim.inventdimid

Data Entities That Expose This Table