Skip to content
D365 Reference

CustInvoiceJour

transaction

Posted 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

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/ValidTo effectivity 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

Header & line

CustInvoiceJour is the header for its lines in CustInvoiceTrans.

Fields

23 fields · 4 key

23 fields.

Table fields: key flag, field name, extended data type, description, data type, length, and quirk flags. 23 fields.
KeyFieldEDTDescriptionTypeLengthFlags
KeyInvoiceIdInvoiceIdThe invoice number; unique only together with InvoiceDate, numberSequenceGroup, and SalesIdstring20
KeyInvoiceDateDate the invoice was posted — the primary analysis date for revenue reportingdate
KeynumberSequenceGroupNumber-sequence group the invoice number was drawn from; part of the composite key (often blank)string10
KeySalesIdSalesIdSales order the invoice was posted from; part of the composite keystring20
InvoiceAccountCustAccountCustomer account the invoice is billed tostring20
OrderAccountCustAccountCustomer account that placed the underlying order (can differ from the invoice account)string20
CustGroupCustGroupIdCustomer group of the invoiced customer at posting timestring10
InvoiceAmountTotal invoice amount in the transaction currencyreal
InvoiceAmountMSTTotal invoice amount converted to the company (accounting) currencyreal
SalesBalanceNet line amount of the invoice before tax and charges, in the transaction currencyreal
SumTaxTotal sales tax on the invoice in the transaction currencyreal
SumLineDiscTotal line discount across the invoice in the transaction currencyreal
CurrencyCodeCurrencyCodeTransaction currency of the invoicestring3
ExchRateExchange rate used to convert the invoice to the accounting currencyreal
DueDatePayment due date derived from the invoice date and payment terms; unset rows carry the 1900-01-01 sentineldate
QtyTotal quantity invoiced across the linesreal
WeightTotal weight of the invoiced goodsreal
LedgerVoucherLedger voucher the invoice posted under — the bridge to general-ledger transactionsstring20
SalesTypeType of the originating sales order (journal, subscription, sales order, returned order…)enum
DlvModeMode of delivery on the invoicestring10
DlvTermTerms of delivery on the invoicestring10
DeliveryPostalAddressRecIdRecId of the ship-to address in LogisticsPostalAddressint64
InvoicePostalAddressRecIdRecId of the bill-to address in LogisticsPostalAddressint64

Field provenance: hand-curated.

Boilerplate SQL

Starting point for reading CustInvoiceJour 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  : CustInvoiceJour Posted 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
-- Purpose: Column-selected read of CustInvoiceJour — auto-generated from field metadata
-- Grain  : One row per company (dataareaid) + InvoiceId + InvoiceDate + numberSequenceGroup + 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
  c.invoiceid AS "The invoice number; unique only together with InvoiceDate, numberSequenceGroup, and SalesId",
  c.invoicedate AS "Date the invoice was posted — the primary analysis date for revenue reporting",
  c.numbersequencegroup AS "Number-sequence group the invoice number was drawn from; part of the composite key (often blank)",
  c.salesid AS "Sales order the invoice was posted from; part of the composite key",
  c.invoiceaccount AS "Customer account the invoice is billed to",
  c.orderaccount AS "Customer account that placed the underlying order (can differ from the invoice account)",
  c.custgroup AS "Customer group of the invoiced customer at posting time",
  c.invoiceamount AS "Total invoice amount in the transaction currency",
  c.invoiceamountmst AS "Total invoice amount converted to the company (accounting) currency",
  c.salesbalance AS "Net line amount of the invoice before tax and charges, in the transaction currency",
  c.sumtax AS "Total sales tax on the invoice in the transaction currency",
  c.sumlinedisc AS "Total line discount across the invoice in the transaction currency",
  c.currencycode AS "Transaction currency of the invoice",
  c.exchrate AS "Exchange rate used to convert the invoice to the accounting currency",
  CASE WHEN CAST(c.duedate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(c.duedate AS DATE) END AS "Payment due date derived from the invoice date and payment terms; unset rows carry the 1900-01-01 sentinel",  -- 1900-01-01 sentinel → NULL
  c.qty AS "Total quantity invoiced across the lines",
  c.weight AS "Total weight of the invoiced goods",
  c.ledgervoucher AS "Ledger voucher the invoice posted under — the bridge to general-ledger transactions",
  c.salestype AS "Type of the originating sales order (journal, subscription, sales order, returned order…)",  -- enum: decode c.salestype via GlobalOptionsetMetadata join — see quirks guide #enums
  c.dlvmode AS "Mode of delivery on the invoice",
  c.dlvterm AS "Terms of delivery on the invoice",
  c.deliverypostaladdress AS "RecId of the ship-to address in LogisticsPostalAddress",
  c.invoicepostaladdress AS "RecId of the bill-to address in LogisticsPostalAddress"
FROM <catalog>.<schema>.custinvoicejour c
-- Resolve LogisticsPostalAddress (via DeliveryPostalAddress): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.logisticspostaladdress deliverypostaladdress ON deliverypostaladdress.recid = c.deliverypostaladdress
-- Resolve LogisticsPostalAddress (via InvoicePostalAddress): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.logisticspostaladdress invoicepostaladdress ON invoicepostaladdress.recid = c.invoicepostaladdress
WHERE
  c.dataareaid = '<company>'
  -- AND c.salesid = '<SalesId>'
  -- AND c.invoicedate >= '<DATE_FROM>'  -- yyyy-MM-dd (UTC)
  -- AND c.invoicedate <= '<DATE_TO>'  -- yyyy-MM-dd (UTC)
ORDER BY c.invoiceid;

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

  • CustInvoiceJourCustInvoiceTransheader line · 1:N
    ON custinvoicejour.invoiceid = custinvoicetrans.invoiceid AND custinvoicejour.dataareaid = custinvoicetrans.dataareaid
  • CustInvoiceJourCustTableforeign key · N:1
    ON custinvoicejour.invoiceaccount = custtable.accountnum AND custinvoicejour.dataareaid = custtable.dataareaid
  • CustInvoiceJourCustTableforeign key · N:1
    ON custinvoicejour.orderaccount = custtable.accountnum AND custinvoicejour.dataareaid = custtable.dataareaid
  • CustInvoiceJourLogisticsPostalAddressRecId ref · N:1
    ON custinvoicejour.deliverypostaladdress = logisticspostaladdress.recid
  • CustInvoiceJourLogisticsPostalAddressRecId ref · N:1
    ON custinvoicejour.invoicepostaladdress = logisticspostaladdress.recid
  • CustTransCustInvoiceJourforeign key · N:1
    ON custtrans.invoice = custinvoicejour.invoiceid AND custtrans.dataareaid = custinvoicejour.dataareaid

Data Entities That Expose This Table

More Sales & Marketing tables

Maintained by Summit Analytics, a supply chain analytics practice. The tools and references are free — the consulting is selective.

Part of the Summit Analytics reference library.

Work with the practice

Not affiliated with or endorsed by Microsoft. Microsoft, Dynamics 365, and Microsoft Fabric are trademarks of the Microsoft group of companies.