Forcing Initial Sync in DualWrite

I am currently working on a project where we are implementing DualWrite in existing Dynamics 365 Environments. Since we do not have huge data volumes we decided to use Initial Sync in DualWrite to migrate some data from D365 Finance and Supply Chain over to D365 for Sales.

When we verified the data we noticed and issue with addresses. It turns out that the customers had all addresses set to purpose Business and as it turns out the addresses that are configured in the default mapping for DualWrite are Delivery and Invoice addresses. Once the customer fixed the addresses, I thought: “Lets just resync the Customer V3 entity using Initial Sync!”. Well… turns out is was not that easy.

When the sync har run it synced 3 customers instead of around 1800…

When I looked at the Data Management Project (after ALOT of troubleshooting) which Initial Sync generates I could see that the project was set to “Incremental Push Only”… I wanted it to do a complete sync… why is this happening?? What do I do know? There are 3 different ways that “might” solve this.

  1. Disable and Enable Change Tracking

    Your first option is to turn, change tracking off and then on again. You do this in the Data Management workspace, in Data Entities.
  2. Reset DualWrite in FnO

    In the DualWrite section of the Data Management workspace, click Reset Link. This will let you setup the link again; as well as purging all of the settings, it will also reset historical configuration. Since we already synced most of the data, we did not have to run initial sync for most of the entities… we only re-ran the Customers V3 entity


  3. Deleting the DMF Project

    Every initial sync created a DMF project and when run the Initial sync for the second time, Dataverse tried to be smart and reuse the DMF project which meant. Deleting the project meant that it had to be created again.
    (Thanks Nathan Clouse for this insight)

    Links:
    https://learn.microsoft.com/dynamics365/fin-ops-core/dev-itpro/data-entities/dual-write/dual-write-troubleshooting-initial-sync?WT.mc_id=DX-MVP-5004702#error-customer-map

DualWrite syncing empty lines on Initial Sync

I had this strange issue today…

One of my customers have set up DualWrite in their DEV environment and after some tweaking it worked OK. With that done they wanted to move the entire solution into TEST and verify that it worked. We packaged all the mappings into a Solution, exported it from DEV and moved it into TEST. We started enabling the Mappings for Legal Entity and a when we looked in CRM/CE we had a bunch of empty lines. We had the same number of lines but all of them were empty.

If we changed the data on one of the Legal Entities it synced over just fine but all the rest were still empty.

When we looked into the DMT files for the data project for the initial sync the files looked “good” to me… they contained data

|NAME|,|LEGALENTITYID|
|LegalEntity1|,|AAA|
|LegalEntity2|,|AAB|
|LegalEntity3|,|AAC|
|LegalEntity4|,|AAE|
|LegalEntity5|,|AAF|
|LegalEntity6|,|AAG|
|LegalEntity7|,|AAH|
|LegalEntity8|,|AAI|
|LegalEntity9|,|AAJ|
|LegalEntity10|,|AAK|
|LegalEntity11|,|AAL|
|Company accounts data|,|dat|

Some of you might already see the issue 🙂 (don’t spoil the surprise) When contacting Support they told me then there is a problem with the text qualifier in the file… the strings should be enclosed in ” instead of |

It turns out that someone had changed the default format CSV-Unicode in Data Management Framework to this:

I changed it back to this:

After cleaning out the records from CRM/CE and rerunning initial sync everything works again…

Enable vs Enabled Features

I have learned that it is important to read the fine print… otherwise you will miss things. This happened to me and a colleague the other day.

In Dynamics 365 for Finance and Operations, Microsoft add new features all the time. These are controlled in Feature Management workspace where you can also read up on the new features to understand important impact.

A cool feature is that there is a Data Entity in the Data Management Framework which exports and imports the feature set for a given environment and enables moving feature settings from one environment to another making easier to manage the lifecycle of your features and sync them with for instance releases

Now comes the part that I completely missed (which in hindsight is quite obvious):

There is a column called Enable Date, which I thought meant “The date the feature was enabled”, what it actually means “The date the feature is enabled”… notice the subtle difference?? I did not 🙁

What the column actually does is to set a schedule for when the feature will be enable. When you use DMF to import a list of feature settings with this field set means that you will schedule the enablement of the feature. It is a great feature but might cause some issues if you are not aware of it. Especially for features that can not be turned off.

Remember: Read and understand the fine print

DMF not creating new project

I had a question today regarding a user that, when she tried to create a new Import project in the Data Management Framework, she ended up in an old existing project.

We tried to clean out usage data and also restarted the server and browser to clear potential cache issues.

Another colleague told me that the issue is relates to saved views… and low an behold, when changing the standard view to be the default it all worked again.

Tip of the week: Getting rid of Standard View

In Dynamics 365 for operations there is a very useful tool called Data Management Framework which is used for import and export of data…

A couple of month ago Microsoft introduced a new view called Enhanced View that I personally think is nice… but for some strange reason (maybe inertia) the Standard View (the old one) is still standard and every time you choose it the UI tells you that “Standard view has been deprecated, and will be removed. You can change your default view to Enhanced on the Data management framework parameters page.” which can be a bit annoying. Microsoft has promised that soon the Enhanced View will be standard… If it was only soon now 🙂

In the mean time you can set the default view.

  1. Go to the Data Management Workspace
  2. Go to Framework Parameters
  3. Change View Defaults to Enhanced

Happy Days!!

My entities are missing…

One of the crucial concepts in Dynamics 365 for Operations are Data Entities… you use them for basically everything. Data entities is an abstraction on top of the regular database table which aggregates multiple table into one object.

Today I had a problem with an entity missing som the entity list. I this happens the solution is usually to refresh the list by going to  System administration – Workspaces – Data management – Data import/export framework parameters and clicking Refresh entity list under Entity Settings.

That did not do the trick today so I had to dig deeper… and found this SQL script that clears the entity list:

-- This source code or script is freeware and is provided on an “as is” basis without warranties of any kind,
-- whether express or implied, including without limitation warranties that the code is free of defect,
-- fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of
-- the code is with the end user.

-- Create backups of the tables first

SELECT *
INTO DMFEntity_backup
FROM DMFEntity
GO

SELECT *
INTO DMFTargetXML_backup
FROM DMFTargetXML
GO

SELECT *
INTO DMFTargetXMLToEntityMap_backup
FROM DMFTargetXMLToEntityMap
GO

SELECT *
INTO DMFTargetEntityHierarchy_backup
FROM DMFTargetEntityHierarchy
GO

-- Truncate the tables
TRUNCATE TABLE DMFENTITY
GO

TRUNCATE TABLE DMFTargetXML
GO

TRUNCATE TABLE DMFTargetXMLToEntityMap
GO

TRUNCATE TABLE DMFTargetEntityHierarchy
GO

Then I go back to Data import/export framework parameters and run Refresh entity list.

That seem to do the trick

NOTE: this procedure has one slight down side and that you are also deleting all mappings for all entities. The (rather tedious) solution is to go into each entity and regenerate mappings… for all 2800+ entities… Wohoo…

Fortunately a smart person on Yammer wrote this script that regenerates all mappings for all entities in one run.

Links:
https://cloudblogs.microsoft.com/dynamics365/no-audience/2016/07/20/data-management-missing-entities-2/?source=axsupport