Develop a custom data entity in D365 F&O
Hello Developers. I welcome you to another splendid article about how to develop a custom data entity in Dynamics 365 Finance and Operations.
What is Data Entity
This is a way to import or export the data in dynamics 365 Finance and Operations.
For Example; Amir (a consumer) wants to access data that is related to a customer, but this data is currently scattered across multiple tables, such as DirParty, CustTable, LogisticPostalAddress, and LogisticElectronicAddress. Therefore, the process of reading and writing customer data is very tedious. Instead, the following customer entity can be designed to encapsulate the entire underlying physical schema into a single de-normalized view
Above images are taken from Microsoft official docs. Microsoft docs
Categories of Entities
Entities are categorized based on their functions and the type of data that they serve. The following are five categories for data entities.
Parameter
Reference
Master (Mostly used)
Document
Entity key on Data Entities
It must be unique. Mostly primary key columns or we can say independent columns likes salesId, we used in it.
Development Steps
How to develop Custom Data Entity using AOT query and View in D365FO?
Step 1: Create New dynamics 364 finance Operation project.
Step 2: Write click on solution explorer of your project and select “Add New Item”.
Step 3: Add Query and rename it.
Step 4: Add Data Source and change its three properties: First is name of your data source, second is Add Table, third is dynamics field property, set it No or Yes according to your requirement.
Step 5: Add relation.
Step 6: Right Click to your Solution Explorer, Add View in your project.
Step 7: Right Click on View your added, go to properties and Add your Query in Query Field.
Step 8: Drag the field you need to show on your view from the Data source of your Query, you last added in View.
Step 9: Add new Data Entity.
Step 10: Add View in your Entity data source by drag and drop and add the fields of your view in the fields of Entity.
Step 11: Add the id, status type fields in Entity Key Fields. Note: Never add Price, Tax type field in Entity Key Important: In entity property, we have a Property Primary company context, add dataAreaId of your root data source table inside this.
Recommended by LinkedIn
Step 12: Right click on your entity and Re-generate the staging table and update also by again right click on entity.
Step 13: Rebuild and Build the project.
Step 14: After build completed, your entity has developed successfully.
1)
2)
3)
4)
5)
6)
7) Computed Fields are highlighted with custom Methods used in computed fields
8) Custom Method for computed field creation
9) Highlighted entity properties must be filled
10) Drag the View in Entity data source. Below showing the fields of view while second highlighted fields are entity fields
11) Drag the fields from view fields to entity fields
12) Entity Key Columns
13) Re-generate and update staging table
14) Rebuild your project with DB sync (True).
D365 Techinical Consultant at Accenture
11mostep 9 is having an issue where view is not listed in the datasource
Associate Software Engineer at 1 Billion Tech | D365 F&O Technical Consultant
1yStep: 9 Add new Data Entity ,I have to select the primary data source what do i want to select for it.
Accountant | Certified Data Analyst | Certified Data Engineer | ColdFusion Certified Developer | DAX | Power BI | Power Platform
2yStep 9 is is making an Issue, when I create a data entity it asks for the base table and I am using an existing table and getting the error that natural key of the table [Table Name] was not found. any solution
Dynamics D365 Sr. Financial Consultant at M.A Al Abdulkarim Co. Ltd.
2yJazak Allah