Skip to content
D365 Reference

OMLegalEntity

Legal entities — one record per company with its registration details and flattened primary address and contact information, the export behind the company list

Tables vs entities

This entity is an export-shaped view over the tables below. When you land raw F&O tables instead of the entity, the SQL further down rebuilds it — joining the backing tables on their keys and DataAreaId. When to land tables vs entities

Notes

CDM-verified (entity version 1.1.1, since 10.0.13). The CDM definition declares a single backing relationship — BackingTable_DirPartyBaseEntityRelationship — with key LegalEntityId and no DataArea attribute: the entity is party-shaped, while CompanyInfo is the landable table its company data lives on (mapped here as the rebuild datasource). OData public collection name (commonly cited as LegalEntities) is not on the CDM page, so it is omitted.

Rebuild-from-tables SQL

Databricks SQL

Starting point for reconstructing this entity from landed tables — the backing tables joined on their keys and DataAreaId. Set your Unity Catalog location, company, and filter values below.

Query parameters

2 parameters not filled: <catalog>, <schema>

-- ============================================================
-- Entity : OMLegalEntity
-- Purpose: Rebuild OMLegalEntity from landed F&O tables — auto-generated from table-entity-map
-- Grain  : One row per CompanyInfo record
-- Tables : CompanyInfo
-- 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. Company-partitioned tables are joined on DataAreaId to prevent cross-company fan-out. System/audit columns omitted — see the quirks guide.
-- ============================================================
SELECT
  h.dataarea AS "The company code this legal entity owns — the natural join to DataArea and to every table's dataareaid"
FROM <catalog>.<schema>.companyinfo h
-- Base-table fields: Name, PartyNumber, LanguageId are inherited from DirPartyTable —
-- a derived table's export lands only its own fields, so they are NOT in companyinfo
-- (see the extraction guide). Sync dirpartytable too, then uncomment (rows share recid):
-- LEFT JOIN <catalog>.<schema>.dirpartytable dp ON dp.recid = h.recid
ORDER BY h.dataarea;

Backing 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.