In Dynamics 365, Dual-write is a powerful feature that enables real-time data synchronization between Dataverse and Dynamics 365 applications like Finance and Operations (F&O) and Customer Engagement (CE). This integration ensures a seamless flow of data across environments, making it easier to maintain accurate and up-to-date information in both systems.
In this article, we’ll guide you through the process of creating a custom entity for Dual-write, allowing you to synchronize custom data between your Dynamics 365 CE and F&O environments.
What is Dual-write?
Dual-write provides out-of-the-box integration between Dynamics 365 F&O and Dynamics 365 CE. It maps data between entities in both environments and enables real-time synchronization. This integration allows organizations to maintain a single source of truth across systems while supporting efficient operations and decision-making.
For custom entities, Dual-write ensures that the custom data in one system is automatically reflected in the other. In this article, we’ll focus on how to create and configure custom entities for Dual-write integration.
What is custom entity
The short answer is It is an entity which is not available in the system and can be create manually based on your business requirement.
- Dual-write provides out-of-box maps for some business processes. However, there might be scenarios where you need additional fields, maps, or transformations.
- The dual-write platform is extensible.
- You can create custom maps and extend existing maps with custom fields to sync data between Finance and Operations apps and Microsoft Dataverse.
Before you customize any maps, make sure to check below conditions.
When the entity is in both the F&O and Dataverse
If the entity is in both environments, create a dual-write map.
•Integration keys for the entity should match in both environments. If the entity key isn’t available on either side, be sure to create entity keys. The integration key fields should be mapped to each other in the map.
•The company field should not be present in the mapping if the entity is legal entity–specific, because the company field will already be part of the key. For an example, review the Employments (cdm_employments) entity mapping.
When the entity is in F&O only
If the entity is in the Finance and Operations app only, create a new entity in Dataverse, and then add a map.
•If the Finance and Operations entity contains data that is legal entity–specific, be sure to add a lookup field to cdm_companies in the new Dataverse entity. If the Finance and Operations entity is global, a field for the company isn’t required in the Dataverse entity.
•Add keys to the Dataverse entity to mimic the Finance and Operations entity key. Dual-write requires the same entity keys in both the Finance and Operations environment and the Dataverse environment. The key fields on the Finance and Operations app and Dataverse should be mapped to each other. Don’t add the company field in the mapping.
When the entity is in Dataverse only
If the entity is in Dataverse only, create a new entity in the Finance and Operations environment, and then add a map.
•Create the new entity and include all the required fields. Make sure that the entity is enabled for Data management and public, so that it can be consumed by OData (Open Data Protocol). For more information about how to create a new entity, see Build and consume data entities.
•If data in the Finance and Operations app should be legal entity–specific, be sure to add a lookup field to cdm_companies in the Dataverse entity. If the Finance and Operations entity is global, a field for the company isn’t required in the Dataverse entity.
•Make sure that both entities have the entity key fields. Dual-write requires the same entity keys in both the Finance and Operations environment and the Dataverse environment. The key fields on the Finance and Operations app and Dataverse should be mapped to each other. Don’t add the company field in the mapping.
Steps to Create a Custom Entity for Dual-write
1. Create a Custom Entity in Dataverse
Before you can enable Dual-write, you need to create the custom entity in Dataverse (formerly known as the Common Data Service). This entity will hold the data that needs to be synchronized across your Dynamics 365 applications.
- Navigate to Power Apps: Go to the Power Apps portal and select Dataverse.
- Create a New Entity: Click on Data > Entities > New Entity.
- Name the Entity: Give your custom entity a name (e.g., “CustomSalesOrder”).
- Define Fields: Add necessary fields that will hold your data, such as order number, customer ID, product details, etc.
- Set Permissions: Ensure the necessary users or roles have access to the entity.

.
2. Create the Entity in Dynamics 365 F&O
Once your custom entity is created in Dataverse, you need to create it in Dynamics 365 F&O so it can be synchronized.
You can create an entity by right click on table > Addins > Create data entity

OR
You can use data entity wizard : Create a new data entity

Consider below things when creating custom entity in D365 F&O.
- Make sure that the entity is enabled for Data management and public, so that it can be consumed by Odata.
- To enable table maps for dual-write, define an alternative key in the Dataverse table. The value of the alternative key in Dataverse must match the key that is defined in the F&O.
3. Map the Entity for Dual-write
To enable Dual-write for your custom entity, you must map it to the corresponding entity in the Common Data Model (CDM).
First login to Dynamics 365 F&O and go to Data Management > Click on Dual-write tile

Click on + Add table map

- Select table (1) from F&O entity
- Select table (2) from Dataverse table
- Create new or select default publisher (3)
- Enter the version (4) and Description (5)
Sample table mapping in Dual-write
Once you are done then you can see your mapping like this as below.

Test the Dual-write Integration
Once the mappings and configurations are in place, it’s time to test the integration:
- Create Test Data: Create a test record in your custom entity in Dataverse (e.g., a test sales order).

Verify Sync: Check if the data appears correctly in F&O and vice versa, based on the sync direction you’ve configured.

Benefits of Dual-write Integration
- Real-time Data Synchronization: Changes made in one system are instantly reflected in the other system, keeping data consistent and up-to-date.
- Improved Operational Efficiency: Dual-write reduces manual data entry and data silos by connecting different systems, helping businesses streamline operations.
- Faster Decision-Making: With real-time synchronization, managers and stakeholders have immediate access to critical data, enabling faster and more informed decisions.
Best Practices
- Field Mapping: Carefully map fields between systems to ensure accurate data synchronization.
- Error Handling: Implement proper error handling mechanisms to track and address any integration issues.
- Test Extensively: Thoroughly test your custom entities and integration before going live to ensure data flows smoothly.
Conclusion
Creating a custom entity for Dual-write in Dynamics 365 enables seamless data integration between Dataverse and Dynamics 365 F&O. This integration helps organizations maintain accurate and synchronized data across platforms, enhancing operational efficiency and decision-making. By following the steps outlined in this article, you can create and configure your custom entities for Dual-write integration, ensuring smooth and real-time data synchronization between systems.




