Matt Beard & I spent some time investigating the new asynchronous merging functionality today and how it impacts Data8 Duplicare (it doesn’t, Duplicare continues to work as normal). If you haven’t seen this already, when you merge two records you’ll now see the message:

The selected records will be merged in the background while you work. For additional information, see Asynchronous Processing of Cascading Transactions.

Now, I like to think I’m pretty competent when it comes to working with D365, but I find that link pretty difficult to follow. I’m not sure what your average user is going to think.

What’s going on?

The documentation talks about the cascading of relationship updates. Now, I have written previously about the merge operation, and it’s true that a large amount of time can be taken by updating related records from the old “subordinate” record to the new “master” record.

However, this documentation doesn’t quite match with the behaviour I see in practise. It talks specifically about the relationship cascading being run in batches of CascadeAssign system jobs. While moving the related records is an important part of the merge operation, it’s not the only part – the subordinate operation also needs to be disabled and linked to the master. In fact, all this now seems to be run in a background system job using the ExecuteAsync method. This gives a system job that looks like:

Notice the “Execute Async Request” type in the top right, not the “CascadeAssign” type shown in the docs.

It appears that, instead of any real change to the merge cascade behaviour directly, the entire merge operation is being run unchanged in an async process. This is fine, but isn’t what the documentation seems to be describing.

What’s also interesting is that the ExecuteAsyncRequest is only meant to be used for ImportSolutionRequest and DeleteAndPromoteRequest messages, but now seems to also work for MergeRequest messages too. I’ve submitted a PR to update this documentation accordingly, but it’s intriguing what other messages if any can now also be executed asynchronously.

Background Errors

As I looked at previously, there are a lot of ways a merge operation can fail. If you’re merging records with different parents, or missing permissions, or a record is inactive, or …

Because this is now run in the background, the user doesn’t see an error. They just see that the records aren’t merged even though they clicked OK. You can go to the system jobs list and see the error I’ve shown above, but that’s hardly user friendly.

Probably the most common error is if you’re merging errors with different parents. This could be contacts in two different accounts, or accounts with different parent accounts. This used to show a warning to the user that they had to click OK on. Now, that warning is shown as an error in the failed system job, with no OK button available to click.

Thankfully, Matt Beard has posted a quick workaround for this which essentially does the “click OK” part for you automatically.

Optional?

One frustrating part of the documentation is that it implies that the asynchronous behaviour can be turned on or off, but with no instructions on how to do it. I’ve hunted around for options to do this but with no luck – please let me know if you find anything!

One thought on “MSDyn365 Internals: Async Record Merging”

  1. I raised a ticket with Microsoft soft support and they provided me with a manage solution, and few instructions to set the merge function to synchronous. Hope it helps

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.