One of the most powerful features in Dynamics 365 Finance and Operations is the Data Management Framework (DMF). Whether you're building integrations, facilitating data migrations, or enabling Excel-based edits — data entities are the cornerstone.
While standard entities cover a wide range of scenarios, there are times when you need a custom entity tailored to your exact business requirement.
Today’s post will walk you through the entire process of building a custom data entity from scratch, using best practices every technical consultant or architect should follow.
When and Why to Build a Custom Data Entity?
Before jumping in, it’s important to ask:
-
Does a standard entity already cover the requirement?
-
Is the customization aligned with business processes?
-
Will the entity be used for inbound, outbound, or dual-directional integrations?
If the answer points to a clear gap, it's time to create your own.
Use Case
Let’s say your client wants to integrate a custom loyalty program with D365 F&O. They’re storing loyalty card data in an external system and want to push it into a custom table named LoyaltyMemberTable
.
Step-by-Step: Building a Custom Data Entity : -
1. Create the Table (If It Doesn't Exist) with the below fields : -
string CardNumber , CustAccount CustomerAccount , TransDate JoinDate , string MembershipLevel
2. Create a New Data Entity
-
In Visual Studio, right-click on your project → Add → New Item → Data Entity.
- Name it
LoyaltyMemberEntity
.
- Set the Primary datasource to
LoyaltyMemberTable
In the properties:
Public = Yes
(if it should be available for integrations)DataEntityView = Auto
IsPublic = Yes
IsReadOnly = No
3. Add Fields to the Entity
Select only the necessary fields — avoid exposing internal or irrelevant fields to keep the integration secure and clean.
You can also rename labels or make fields mandatory here.
4. Build and Synchronize
Once the entity is created:
-
Build your solution.
-
Sync the database to register the entity in the DMF.
You’ll now find your new entity under Data Management Workspace > Data Entities.
5. Test It
Use the Data Management Workspace:
-
Try exporting data using your new entity.
-
Then test an import with a sample Excel file.
Best Practices to Remember :-
-
Use surrogate keys wherever possible to simplify mapping and support system-generated RecIds.
-
Limit the number of exposed fields — keep entities lean and focused.
-
Add business logic in postLoad/postWrite methods only if necessary.
-
For larger datasets, enable incremental export to improve performance.
Pro Tip: Extend an Existing Entity When Possible
Before creating a new one, check if an extension of a standard entity can serve your purpose. It keeps things clean and ensures you’re building only what’s needed.
Conclusion
Custom data entities are more than just a way to move data — they’re critical building blocks in a well-architected D365 ecosystem. Whether you're integrating with external systems, enabling Excel-based edits, or facilitating controlled data migrations, knowing how to build a reliable entity is essential.
As a D365 F&O technical consultant or architect, being comfortable with data entities isn’t just a technical skill — it’s a must-have competency for delivering real-world business value.
That's all for now. Please let us know your questions or feedback in comments section !!!!