D365 FO/AX7: Composite Data Entities Vs Data Entities With Example

  • Introduction – Data management framework of Microsoft Dynamics 365 finance and operations contains a very important technical asset called Data Entities. Data entities are conceptual combinations, abstraction and encapsulation of one of more underlying tables. Data entities in Microsoft D365 finance and operations are used to import and export data in Microsoft Dynamics finance and operations. Odata integration can also be achieved using D365 finance and operations data entities. We can customize standard data entity . Click Here to know about standard data entity customization.
  • Composite Data entity vs Simple Data Entity- There are some differences between Composite Data entity & Simple Data Entity. 1 ) First of all simple data entity contains one or more tables where as composite data entity contains multiple data entities 2) Simple Data entities support Odata & can be used in Odata integration whereas Composite data entities cannot be used Odata integration.
  • Where should we use Composite Data entity ?-Composite entity is used in scenarios where an entity can be represented as a single document, like Purchase Header/line , Sales header/line, Invoice header/line etc.
  • Example & Development of Composite Data entity steps are mentioned below :
  • In example i am taking 2 separate standard data entities i.e. PurchPurchaseOrderHeaderV2Entity & PurchPurchaseOrderLineV2Entity
  • PurchPurchaseOrderHeaderV2Entity contains purchase order header information & fields mainly purchTable Fields
  • PurchPurchaseOrderLineV2Entity contains purchase order Lines information & fields mainly PurchLine Fields
  • We will develop a new composite data entity by using above 2 data entities and compose data entity will represent a single purchase order document (Purchase Order Header + Purchase Order Line)
  • Now create a composite data entity in your project.
  • Extend PurchPurchaseOrderLineV2Entity and create relation with PurchPurchaseOrderHeaderV2Entity. (NOTE In my case standard relation is already there so no need to create any customize relation)
  • Right click on your composite data entity and add “New Root Data Entity Reference” and make sure property Data Entity should be equal to PurchPurchaseOrderHeaderV2Entity
  • Right click on your “New Root Data Entity Reference” PurchPurchaseOrderHeaderV2Entity and add “New Embedded Data Entity Reference” equals to PurchPurchaseOrderLineV2Entity & Property Relation should be equal to PurchaseOrderHeader.
  • Extend staging table (PurchPurchaseOrderLineV2Staging) of data entity PurchPurchaseOrderLineV2Entity and add relation with the staging table (PurchPurchaseOrderHeaderV2Staging) of data entity PurchPurchaseOrderHeaderV2Entity.(NOTE : In my case standard relation already exist so i am not creating any relation)
  • Add two columns, RowId and ParentRowId (type int), on all the staging tables i.e. PurchPurchaseOrderHeaderV2Staging & PurchPurchaseOrderLineV2Staging.
  • Create a cluster index on the staging tables which includes RowId, ParentRowid,DefinitionGroup, and ExecutionId for getting good performance .
  • Build and synchronize your project
  • Under “Data import/export framework parameters”, select fast tab “Entity Settings” and click on “Refresh Entity List”. Here is LINK AND TUTORIAL.

Leave a Reply