D365 Reference
SalesTable
worksheet headerSales order header — one row per order carrying customer, status, site, and requested dates
Module: Sales & MarketingCompany-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
SalesTable is the header for its lines in SalesLine.
Fields
28 fields · 1 key
28 fields.
| Key | Field | EDT | Description | Type | Length | Flags |
|---|---|---|---|---|---|---|
| Key | SalesId | SalesId | The sales order number — the natural key sales lines join back on | string | 20 | |
| CustAccount | CustAccount | Customer account the order is for | string | 20 | ||
| SalesStatus | Order status across its life cycle | enum | ||||
| SalesName | Free-text order description | string | 60 | |||
| InventSiteId | InventSiteId | Default site for the order | string | 10 | ||
| ReceiptDateRequested | Requested receipt date; the primary analysis date for the header | date | ||||
| InvoiceAccount | CustAccount | Customer account the order will be invoiced to (can differ from the ordering account) | string | 20 | ||
| CustGroup | CustGroupId | Customer group of the ordering customer, copied to the order | string | 10 | ||
| SalesType | Type of order (journal, subscription, sales order, returned order…) | enum | ||||
| CurrencyCode | CurrencyCode | Transaction currency of the order | string | 3 | ||
| DeliveryDate | Delivery date on the order header; unset rows carry the 1900-01-01 sentinel | date | ||||
| ShippingDateRequested | Requested ship date for the order; unset rows carry the 1900-01-01 sentinel | date | ||||
| ShippingDateConfirmed | Confirmed ship date; unset until confirmation, so rows carry the 1900-01-01 sentinel | date | ||||
| ReceiptDateConfirmed | Confirmed receipt date; unset until confirmation, so rows carry the 1900-01-01 sentinel | date | ||||
| InventLocationId | InventLocationId | Default warehouse for the order | string | 10 | ||
| DlvMode | Mode of delivery for the order | string | 10 | |||
| DlvTerm | Terms of delivery for the order | string | 10 | |||
| Payment | Terms of payment for the order (note: the column is Payment, not PaymTermId) | string | 10 | |||
| TaxGroup | TaxGroup | Sales tax group for the order | string | 10 | ||
| CustomerRef | The customer's own reference for the order | string | ||||
| PurchOrderFormNum | The customer's purchase order number | string | ||||
| SalesOriginId | Sales origin (channel) code recording where the order came from | string | 10 | |||
| SalesPoolId | Sales pool used to group orders for processing and reporting | string | 10 | |||
| SalesGroup | Commission sales group on the order | string | 10 | |||
| WorkerSalesTaker | RecId | RecId of the worker who took the order (references the HR worker table) | int64 | |||
| WorkerSalesResponsible | RecId | RecId of the worker responsible for the order (references the HR worker table) | int64 | |||
| LanguageId | Language documents for the order are printed in | string | 10 | |||
| DeliveryPostalAddress | RecId | RecId of the order's ship-to address in LogisticsPostalAddress | int64 |
Field provenance: hand-curated.
Boilerplate SQL
Starting point for reading SalesTable 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>, <SalesId>, <DATE_FROM>, <DATE_TO>
-- ============================================================
-- Table : SalesTable Sales order header — one row per order carrying customer, status, site, and requested dates
-- Purpose: Column-selected read of SalesTable — auto-generated from field metadata
-- Grain : One row per company (dataareaid) + SalesId
-- 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
so.salesid AS "The sales order number — the natural key sales lines join back on",
so.custaccount AS "Customer account the order is for",
CASE so.salesstatus WHEN 0 THEN 'None' WHEN 1 THEN 'Backorder' WHEN 2 THEN 'Delivered' WHEN 3 THEN 'Invoiced' WHEN 4 THEN 'Canceled' ELSE CAST(so.salesstatus AS STRING) END AS "Order status across its life cycle", -- enum: SalesStatus
so.salesname AS "Free-text order description",
so.inventsiteid AS "Default site for the order",
so.receiptdaterequested AS "Requested receipt date; the primary analysis date for the header",
so.invoiceaccount AS "Customer account the order will be invoiced to (can differ from the ordering account)",
so.custgroup AS "Customer group of the ordering customer, copied to the order",
so.salestype AS "Type of order (journal, subscription, sales order, returned order…)", -- enum: decode so.salestype via GlobalOptionsetMetadata join — see quirks guide #enums
so.currencycode AS "Transaction currency of the order",
CASE WHEN CAST(so.deliverydate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(so.deliverydate AS DATE) END AS "Delivery date on the order header; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(so.shippingdaterequested AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(so.shippingdaterequested AS DATE) END AS "Requested ship date for the order; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(so.shippingdateconfirmed AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(so.shippingdateconfirmed AS DATE) END AS "Confirmed ship date; unset until confirmation, so rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(so.receiptdateconfirmed AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(so.receiptdateconfirmed AS DATE) END AS "Confirmed receipt date; unset until confirmation, so rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
so.inventlocationid AS "Default warehouse for the order",
so.dlvmode AS "Mode of delivery for the order",
so.dlvterm AS "Terms of delivery for the order",
so.payment AS "Terms of payment for the order (note: the column is Payment, not PaymTermId)",
so.taxgroup AS "Sales tax group for the order",
so.customerref AS "The customer's own reference for the order",
so.purchorderformnum AS "The customer's purchase order number",
so.salesoriginid AS "Sales origin (channel) code recording where the order came from",
so.salespoolid AS "Sales pool used to group orders for processing and reporting",
so.salesgroup AS "Commission sales group on the order",
so.workersalestaker AS "RecId of the worker who took the order (references the HR worker table)",
so.workersalesresponsible AS "RecId of the worker responsible for the order (references the HR worker table)",
so.languageid AS "Language documents for the order are printed in",
so.deliverypostaladdress AS "RecId of the order's ship-to address in LogisticsPostalAddress"
FROM <catalog>.<schema>.salestable so
-- Resolve LogisticsPostalAddress (via DeliveryPostalAddress): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.logisticspostaladdress log ON log.recid = so.deliverypostaladdress
WHERE
so.dataareaid = '<company>'
-- AND so.salesid = '<SalesId>'
-- AND so.receiptdaterequested >= '<DATE_FROM>' -- yyyy-MM-dd (UTC)
-- AND so.receiptdaterequested <= '<DATE_TO>' -- yyyy-MM-dd (UTC)
ORDER BY so.salesid;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 salestable.salesid = salesline.salesid AND salestable.dataareaid = salesline.dataareaidON salestable.custaccount = custtable.accountnum AND salestable.dataareaid = custtable.dataareaidON salestable.deliverypostaladdress = logisticspostaladdress.recid
Data Entities That Expose This Table
More Sales & Marketing tables
- CustGroupCustomer group master — one row per posting/reporting group of customers, carrying default payment terms and the settle-period used to derive due dates
- CustInvoiceJourPosted customer invoice header — one row per invoice issued from a sales order (or free-text posting), with totals, currency, due date, and the ledger voucher it posted under
- CustInvoiceTransPosted customer invoice line — one row per invoiced line with item, quantity, price, and amounts; the revenue-by-item grain of order-to-cash analytics
- CustPackingSlipJourPosted packing-slip header — one row per shipment document posted against a sales order, with delivery date, ship-to address reference, and carrier details
- CustTableCustomer master — one row per customer account, with the RecId links to its global-address-book party and its default financial dimensions
- SalesLineSales order line — one row per order line; the core sell-side transaction, joined to its header by SalesId