Setup Dual-write framework
Velkomen, in this article we will see how we can setup dual-write framework to achieve real time integration between Finance and Operations (FO) and Power Platform (Common data services). For detail introduction and requirements for dual-write please read my blog.
The goal here is explain important concepts that we must follow for successful integration between both systems.
Region supported
Asia, Australia, Canada, Europe, India, Japan, South America, United Kingdom, United States
Setup CDS Environment
Install the following two dual-write solution form AppSource.
Sign in into PowerApps and go to Solution -> AppSource.
Grant CDS app access to FO (inside FO instance)
Open your instance of the Finance and Operations app, search and navigate to Azure Active Directory applications.
- Select New to add a new client ID record: 6f7d0213-62b1-43a8-b7f4-ff2bb8b7b452. This record is the application ID for an app that will be used to connect from Common Data Service to the Finance and Operations app.
- Repeat the above to add another record: 2e49aa60-1bd3-43b6-8ab6-03ada3d9f08b.
When you've finished, follow these steps to refresh the list of entities:
1. Go to Workspaces > Data management, select the Data entities tile, and make sure that the entity list is filled in.
2. Go to Workspaces > Data management and select the Framework parameters tile. Then, on the Entities tab (https://<BaseFinanceandOperationsappsURL>/?cmp=USMF&mi=DM_DataManagementWorkspaceMenuItem&TableName=DMFDefinitionGroupEntity), select Refresh entities list.
Grant a FO app access to CDS (inside CDS instance)
Go to your CDS instance add these followitn two apps as new application users and provide them appropriate role for example system administrator.
App user with id 00000015-0000-0000-c000-000000000000
App user with id 2e49aa60-1bd3-43b6-8ab6-03ada3d9f08b
Make sure steps related to both plugins DualWriteRegistration.Plugins & DualWriteRuntime.Plugins must not be disabled. You can check this using Plug-in Registration Tool.
Furthermore make sure you do not have Prospect to Cash (P2C) solution installed because both cannot work together.
For more information please read here.
Setup Finance and Operations
The setup process depends upon your subscription and varies for new and existing environment and.
1. For new instances of Finance and Operations apps, you can setup dual-write connection in Microsoft Dynamics Lifecycle Services (LCS). Please note if you have a license for Power Platform, you will get a new Common Data Service environment if your tenant doesn't have one.
2. For existing instances Finance and Operations apps, the setup of a dual-write connection begins in the Finance and Operations environment.
New Instance:
You must be an admin in both Finance and Operations environments and Common Data Service environments. Follow Microsoft link here to setup from LCS setup.
Existing Instance
This is one where we will focus more in this blog.
- Sign into the Finance and Operations app environment that you want to link to your Common Data Service environment.
- Go to Workspaces > Data management, and select the Dual Write tile.
- Select New link to environment to open the Setup link to Common Data Service wizard.
- The Choose environment page lists all the Common Data Service environments where the signed-in user is an environment admin. Select the
Common Data Service environment to link to, and then select Next.
Common Data Service environment to link to, and then select Next.
- A health check is run to verify that your system meets the requirements for enabling dual-write.
- Review the summary, privacy notice, and consent, and then select Create.
We have now linked your Finance and Operations app to the Common Data Service environment.
- Apply the dual-write application orchestration solution and click Apply Solution in FO Dual-write page. After apply you should see that the default entity maps are published
You've now successfully imported and applied a Microsoft-published dual-write entity map solution to your environment.
Enable entity maps for dual-write
Below picture shows some sample entity mapping.
Customer V3 (example mapping)
Forexample on (Customers V3—Contacts) mapping select Run, a dialog box appears before the entity map is enabled. This dialog box lists all the dependent entities. You can select the Show related entity map(s)
Filtering and field mapping
With Dual Write, we are providing you the ability to filter data using OData filter expression for Common Data Service. For Dynamics 365 for Finance and Operations, filtering is like range expressions used in query range.
Click here for more examples on using expressions in query ranges.
As compared to out of box (standard) fileds mapping provided by dual write as built in templates (when you install) you can customize entity and field mappings. Example Customer V3 choose you can add your own mapping as well.
You can also set the direction of flow.
Additionally, define your own value transforms (default, truncate, valuemap) by specifying the Transform type and its value.
The following is a description of each of the symbols that indicate sync direction:
Following is a description of each of the transform type:
Defining Alternative keys (linking entities)
To enable Dual Write, an alternate key must be defined in Common Data Service. The alternate key value in Common Data Service must match with key defined in Dynamics 365 for Finance and Operations. For example, CustomerV3 (FO) -> Account (CDS)
We also make sure that accountnumber is mapped to CustomerAccount in the Customers V3 entity map.
Entity (map) status and actions
When we first enable entity map it begins with Not running status.
During the initialization phase, any pre-existing data that you have is copied as part of the initial write phase.
Make sure to enable dependent entities as almost every data is relational in CRM systems.
The goal of this blog is to make the integration process smooth by demonstrating the steps in order. Hope this will would beneficial for community.
I also recommend do read Microsoft article for more related concepts.
Adnan Samuel