Dual write – Live sync
Contents
1. Overview................................................................................................................................ 2
2. Prerequisites .......................................................................................................................... 2
3. Lab steps ................................................................................................................................ 3
3.1. Explore the FinOps 3 key Dual write tables ................................................................... 3
3.2. Explore CE Dual write key table ..................................................................................... 6
3.3. Live sync FinOps to Dataverse ..................................................................................... 10
3.4. Live sync Dataverse to FinOps ..................................................................................... 14
1. Overview
This topic provides general information for dual-write integration between Finance and
Operations apps and Dataverse for live sync operation.
Dual-write is an out-of-box infrastructure that provides near-real-time interaction between
customer engagement apps and finance and operations apps. When data about customers,
products, people, and operations flows beyond application boundaries, all departments in an
organization are empowered.
Dual write provides tightly coupled, bidirectional integration between finance and operations
apps and Dataverse. Any data change in finance and operations apps causes writes to
Dataverse, and any data change in Dataverse causes writes to finance and operations apps.
This automated data flow provides an integrated user experience across the apps.
For the mappings that are in running state, live sync capabilities provide bidirectional real time
experience where the data will be propagated right away to the other system. Maps can be
setup just for unidirectional. If the mapping is stopped, no live sync will happen.
From Finance and Operations point of view, live sync relies on business events functionality.
From Dataverse point of view, we’ll have Odata and plugins.
The user (same as some out of the box maps have) can add filters at mapping level for FinOps
and Dataverse to exclude records for the synching.
For Live sync FinOps to Dataverse, to have a successful sync, the following pre-requisites needs
to be met:
- Changes must be in a transaction
- Recordset operations (insert/update) and records where
skipBusinessEvents(true)/skipEvents(true) is marked and/or doUpdate,doInsert or
doDelete methods , will not be handled by business events and subsequently DW.
- Business events must be registered for the data source which is mapped. There can be
data sources which are outer join and marked as readonly in FnO. These data sources
are not generally tracked.
- Changes will be triggered only if the modifications are on the mapped fields.
Unmapped field modification will not trigger DW
- Filter evaluation should provide valid result.
- User should have minimum view privilege on the entity being synced.
To avoid any data missing issue (lookup failed) while triggering a live sync scenario, you may
review that the mapping and dependent ones have run initial sync successfully.
2. Prerequisites
Lab prerequisites are: Dual Write installed and environments linked.
-Finance and Operations app environment with Power Platform link enabled.
-HOL_Dual write installation and setup: Dual write needs to be configured and Solutions
applied in Dual write UI.
-HOL_Dual write_initial sync.
- Mapping should be in running state.
3. Lab steps
3.1. Explore the FinOps 3 key Dual write
tables
The information for the mappings in running state is saved on 3 key Dual write FinOps tables:
DualWriteProjectConfiguration, DualWriteProjectFieldConfiguration and
BusinessEventsDefinition.
BusinessEventsDefinition is a key table looked for Live sync scenarios where you will find out
the tables/datasources tracked for triggering the live sync.
Navigate to Dual write UI (Finance and Operations > Data management workspace > Dual
write)
Locate a map that is running, for example Customer groups.
Now open the 2 key Dual write tables and explore the data. You can use table browser as
below:
- Dual write Project Configuration:
https://FinOpsUrl/?mi=SystableBrowser&tableName=DualWriteProjectConfiguration
In healthy scenario, you will see two lines per each running mapping, one with IsDelete
checkbox to yes (setup line responsible of deletes) and another one without it (setup line
responsible of inserts and updates).
Confirm that in ExternalEnvironmentUrl you have the corresponding Odata call for your CE
environment with the relevant entity
Project Name column will store the unique project name that identifies a map – that will
match with the project Id field from column named “Unsecure” from key table
DualWriteRuntimeConfiguration in CE that you will explore in the next lab step.
QueryFilterExpression column stores the filter setup at mapping level.
Status = Enabled, meaning that mapping is healthy for operations.
- Dual write Project FieldConfiguration:
https://FinOpsUrl/?mi=SystableBrowser&tableName=DualWriteProjectFieldConfigurat
ion
This table stores the following information per running map (2 records per map):
Dual write alert settings column: information for alerts setup on a particular map. Information
is encoded.
External lookups url: lookup fields for mapping fields.
Field map: map fields
ServiceBusConnectionString and StorageAccountSASConnections: Dual write connection
information encoded.
Project name matching with the project name map in DualWriteProjectConfiguration table.
- BusinessEventsDefinition:
https://FinOpsUrl/?mi=SystableBrowser&tableName=BusinessEventsDefinition
This table stores the tracked information for live sync operations in FinOps. You will have
relevant information such tableId, datasource tracked, legal entity, name of map etc.
3.2. Explore CE Dual write key table
During this step you will inspect the information stored in Dual write runtime configuration
table in Dataverse where it is stored relevant data for Dual write maps.
Connect to your Dataverse, either from Main screen select settings > Advanced settings or
navigate to Dynamics 365 – custom > Settings > Advanced settings.
Select Advanced Find using filter icon in top right.
Search for Dual write Runtime Configurations and to add all the columns in the form result,
click Edit Columns.
Click on Add Columns.
Mark all and select Ok. Then Ok again.
Click Result
Identify the desired map you would like to inspect by External entity name or Internal entity
name, for example Customer groups.
Name column will show the DWM project corresponding to the map initial synchronization
project.
Status = Active means the mapping is healthy for operations.
Most of the relevant mapping information is stored under Unsecure column. Match the Project
name column for your map in DualWriteProjectConfiguration table and Project Id in Unsecure
in Dual Write Runtime configuration for same map and confirms that matches.
3.3. Live sync FinOps to Dataverse
For this live sync example, we’ll create a new customer from Finance and Operation and it
should be created by Dual write in Dataverse.
Navigate to Dual write UI and confirm that your mapping Customers V3 (account) is in running
state and initial sync ran for this mapping and its dependent ones.
Our mapping is setup as bidirection, so it will sync from FinOps to Dataverse and Dataverse to
FinOps.
Navigate now to Finance and Operations > Accounts receivable > Customers > All customers.
Select New
Fill in the necessary fields that are mandatory.
Customer account = Cust001
Name = HOLCustLive sync 001
Customer group 10
Select Save
Once customer is created in Finance and Operations, navigate to Dataverse to confirm that it
has been propagated there.
You can verify if the Account was created from Accounts form, filtering by Account or name
using All accounts view:
Click on the record to go to Accounts main page for that particular recently created account.
Or from Advanced Find: Advanced settings > Advanced Find:
Select Advanced Find using filter icon in top right.
Select Accounts table and just to filter out customers created today you can add filter by
Created On as below, then click Results. If you need to visualize other column that does not
appear by default, select Edit Columns and include it.
Confirm that customer has created properly.
3.4. Live sync Dataverse to FinOps
Now let’s create the account (customer) from Dataverse.
Navigate to Accounts and select New.
We’ll keep Company as by default one (USMF).
Fill in following details:
Account Number = Cust002
Account Name = HOLCustLive sync 002
Relationship type = Customer
Customer Group Id = 20
Click Save.
Once the record is saved, verify that you have activity on Timeline and also Party Id has been
populated.
Now verify that this account has been propagated via Dual write to Finance and Operations.
Navigate now to Finance and Operations > Accounts receivable > Customers > All customers.
If screen was already opened, please refresh.
Find out the customer: