Tip #1119: How is From resolved to Dynamics 365 record

Mini Truckstop

Dynamics CRM TipperToday we have a stop with two Vikings (different countries though): Jonas “The Shuffler” Rapp and Marius Agur Hagelund Lind

Jonas – Question

Recently we have found a new (?) problem at a customer, where emails are incorrectly “connected” to the wrong sender.

By what rule/rules does Dynamics 365 chose which record to track as ”From” when an incoming email is automatically tracked, and the sending emailaddress exists on more than one record type in Dynamics 365? E.g. if the same emailaddress exists on a contact and on a systemuser, will the from-field of the incoming, automatically tracked, email be set to the contact or the systemuser?
And why?

Marius – Answer

From my testing with a decently sized bank it looks like it matches the following way:

  1. systemuser
  2. contact, order by created on
  3. account, order by created on
  4. lead, order by created on
  5. queue

Additionally, automatic case creation with “automatically create contacts” option will only check contact, account and leads. If the email is sent from another queue or systemuser then a contact will be created, even if the address exists (might have been fixed in the most recent months)

Tîpp Jäår

Now I know and so do you.

Tip #1117: Category/delegate tracking in Dynamics 365

If you have been a long-time reader of CRM Tip of the Day, you know that we have had a lot to say about delegate tracking, or the lack thereof, in Dynamics 365 with server-side synchronization. That’s why we are very excited about the announcement earlier this month of the new Outlook category based tracking in update With this update, we now have a viable delegate tracking option for emails and appointments, as well as an answer to some long-missing scenarios for activity tracking.

How do I set it up

Read the official documentation. It’s pretty easy:

  1.  Enable the OrgDbOrgSetting TrackCategorizedItems.
  2. Within 15 minutes, all users will see a new category in Outlook, “Tracked to Dynamics 365”
  3. Users set the category on emails or appointments that they wish to track, and these items will be tracked in Dynamics.

Why is this important?

In industries like financial services, professional services, or the higher up the org chart you go in enterprise companies, you will find people whose inbox and calendars are managed by professional assistants. If these people want their activities tracked to Dynamics 365, they have been out of luck without using some complicated workarounds (or sticking with client-side synchronization, which is not optimal, because the delegate activities don’t track if the owner of the calendar isn’t running Outlook and the Outlook client at the time the activity is tracked and because client-side synchronization is gone in version 9 of Dynamics 365).

A secondary reason that this matters is because the tracking story has been very limited outside of the world of Outlook. Sure, that world has grown exponentially bigger with the introduction of the Outlook App for OWA and Outlook mobile, but if you use a different email client than Outlook, the only option to track emails is folder based tracking (and no option for appointments). With category tracking, users of other email applications can track emails and appointments, as long as their app supports exchange categories (sorry IOS Mail).

A surprise benefit of this change is now tracked items (regardless of how they were tracked) will now have the category set to “Tracked To Dynamics 365” if this option is enabled. This will make it easy to visually identify the tracked items.


  • 8.2 only. V9 update to enable category based tracking is in the works.
  • Category based tracking does not “set regarding” item on the activity. Activities will be linked to the recipient/activity parties linked to the activities, but if you want to set regarding a specific record, the recommendation is to use another tracking mechanism, like the Outlook app or folder-based tracking.
  • The public release is for D365 Online. If you are on D365 8.X on premises and need this update, open a support ticket with Microsoft.

Tip #1116: Microsoft Dynamics 365 Documents are Open Source

This tip is from Aron Fischman from xRM Edge.  (You can be a tipster too, just send your revelation to jar@crmtipoftheday.com)

This topic may be old news for you but I just found out about it.

Today as I was researching a development topic I was pleasantly surprised to find out that Microsoft has open-sourced the Dynamics 365 documentation. After reviewing an article, out of curiosity I clicked its “Edit” icon:

Edit icon in Microsoft docs

To my surprise it opened the article’s GitHub Markdown editing page:Microsoft docs are using Markdown

I was impressed to see that Microsoft is a) hosting its documentation on GitHub, b) writing it in Markdown, and c) allowing anyone to submit changes. This article explains more.

Tîpp Jäår $0.02

What are you waiting for? If you ever held a grudge that the documentation “is not what it should be”, here’s your chance! Head off to Dynamics 365 CE Microsoft Docs on Github, fork, write, then pull!

Facebook and Twitter cover photo by Álvaro Serrano on Unsplash

Tip #1115: Bulk edit workflow emails

Today’s tip comes from Nicholas Hayduk. (You can be a tipster too, just send your revelation to jar@crmtipoftheday.com.)

We recently had a customer who added an SSL certificate to their Adxstudio v7 Portal and now wanted to use the HTTPS version as their main URL. Since their site was hosted in an Azure Web App, we were able to easily add a rewrite rule to force all traffic to HTTPS (https://blogs.msdn.microsoft.com/benjaminperkins/2014/01/07/https-only-on-windows-azure-web-sites/). However, the redirect adds unnecessary overhead, so we wanted to update any links we had to the site to use HTTPS so the overhead could be avoided. One place where links needed to be updated was in their workflows; they had dozens of emails being created in workflows with links back to their websites. Anyone with experience using the email editor in Dynamics 365 knows it can be a bit finicky; we really didn’t want to have to go into all of these emails and change the links. Making matters worse, these emails were html-formatted emails (created by copying HTML into the editor), with many of link URLs not being directly editable, so we would’ve had to start from scratch, including re-adding all of the dynamics fields to the body of the emails. This would’ve taken hours/days with a high likelihood of errors.

Thankfully there was a better way. We exported the solution, unzipped it, and used a find-and-replace tool (http://findandreplace.io/) to quickly and easily change all of the links in workflow emails (each workflow is stored in its own file in the solution, so we wanted a tool that could find and replace across multiple files). We then zipped the solution back up, re-imported, and all was well.

In doing our research to see if this was possible, we did find some horror stories about editing the workflow definition manually causing workflows to no longer be editable in the CRM. This didn’t happen to us; I suspect this isn’t an issue when you are just changing the text in the email body.

Tîpp Jäår $0.02

It’s no longer necessary to edit web.config to force https on your Azure Web App. SSL Settings for the web app now contain a simple HTTPS Only switch. As far as the workflow editing is concerned, the usual Tîpp Jäår’s disclaimer applies: not [currently] supported, use at your own risk, contains small children between the flags, not to be consumed with alcohol while driving.

Facebook and Twitter cover photo by Lastly Creative on Unsplash

Tip #1114: Check scalability of your canvas PowerApp

PowerApps are very expressive when it comes to data filtering, sorting, and other data manipulations. To maximize the application performance, PowerApps have a concept of delegation where PowerApps will delegate the processing of data to the backend instead of pumping data to the app for local processing.

For your application to scale it’s important to use delegable queries so that the backend does most of the heavy lifting. To quickly check if you’re using non-delegable queries anywhere click on File > App Settings > Experimental Features and then set the data row limit to 1:

Non-delegable query limit

From that moment, all your delegable queries will continue to run normally while non-delegable ones will return precisely one row. So when you see a single row in the results where more is expected, you know that you have something to work on!

Facebook and Twitter cover photo by William Bayreuther on Unsplash

EDIT: The above is valid for canvas apps, of course. But I can be forgiven – it’s difficult to keep referring to our beloved Dynamics CRM / 365 as a simple model-driven PowerApp(s).

Tip #1113: Bing Maps disappearing act

This tip is from Miquel “Third musketeer” Julien (who runs an excellent http://www.guidemicrosoftdynamics.com/ French Dynamics 365 tipping site).

If your Bing Maps integration is disabled (under Settings > Administration > System Settings > General tab) then any section containing Bing Maps control will be hidden, regardless of any controls it may contain.

1,000 words™

Bing Maps hides section


Tip #1112: Impersonate Azure AD users

Developers are familiar with the concept of impersonating Dynamics 365 users. It’s easy – all you need to do is to add MSCRMCallerID header to your Web API request, and you’re done (assuming that you have prvActOnBehalfOfAnotherUser privilege).

One of the typical scenarios where you’d want to use the impersonation when you have a web site that connects to your Dynamics 365 instance using either non-interactive user or, better, S2S authentication and then you need to impersonate a currently logged on Azure AD user. The typical flow is: look for a UPN claim, then use that value to find the user in systemuser entity filtered by domainname attribute.

The problem is that UPN claim does not seem to be available when you’re using B2B guest users. In both scenarios a different oid claim is available that returns Azure AD object ID. That value can be used to query systemuser entity using azureactivedirectoryobjectid attribute. Then it’s business as usual, plonk systemuserid value into MSCRMCallerID header and you’re done.


The following approach is undocumented (hopefully not for long!). The usual Tîpp Jäår’s disclaimer applies: not [currently] supported, use at your own risk, contains small children between the flags, not to be consumed with alcohol while driving.

Instead of using Azure AD object ID to lookup the user, pass that id as MSCRMCallerObjectID header.

POST [Organization URI]/api/data/v9.0/accounts HTTP/1.1
MSCRMCallerObjectID: 00000000-0000-0000-000000000002
Accept: application/json
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0

Saves you the need to lookup systemuser and splitting the logic depending on the user type.

Facebook and twitter cover photo by Greg Ortega on Unsplash.

Tip #1111: Fake mobile devices

When Scott “Mr Ribbon Workbench” Durow was delivering his “Typescript or Die” presentation at CRMUG EMEA last month, he stunned the audience by showing his phone right on the screen without any pairing.

He tricked everyone, of course; I don’t believe he even has an iPhone. Turns out, Google Chrome has a not-so-obvious menu when you render things for a predefined form factor.

  • Open a site in Chrome
  • Press Ctrl-Shift-I to get developer tools (or F12)
  • Press Ctrl-Shift-M to get a mobile toolbar. You should see something like this:
    Site in iPhone in Google
  • Click on triple-dot menu (have no idea how is it called but it’s not a waffle or burger. Waffger? Burfle?), then click on Show Device Frame
    Show device frame
  • You now have an iPhone!
    iPhone frame in Chrome

I was hoping for custom frames for all the devices but seems that this art form is reserved for the fruity family.

Tip #1110: Don’t let your workflow emails go to waste

What is your first reaction when you receive email like this one

Let’s see. Comes from someone with the name “Workflow”, has attachment and no body text, and refers to financial matters (payment advice/invoice/quote). Delete? Delete!

Out of curiosity I did peek into the email just to see what kind of nasty attachment they sent this time and turns out, it was a legitimate notification from the customer’s accounts payable.

Sending emails is one of the most common uses of the workflow engine in Dynamics 365. But if you are not careful you’ll end up sending something that most likely will end up in a junk, either automatically or as deleted by the recipient.

What can you do?

  • Disclose the sender. Either give the sender a meaningful name, e.g. Contoso Accounts Payable, or don’t give any name at all leaving a raw email address, e.g. accounts-payable@contoso.com. Latter is not impossible to do out of the box in Dynamics 365 but could be challenging.
  • Have the body. Make sure your email contains body text. Heck, anything is better than none at all. But your chances of getting in front of the user’s eyes are much improved the more eloquent and relevant you are.
  • Stay on topic. It might be tempting to shove your monthly special offer into the payment advice email, that’s a sure fire way to end up in a rubbish bin.
  • Be personal. Dynamics 365 workflow makes it very easy to insert some information that makes the email unique, personal, and relevant. How about starting with “Dear Joe Bloggs”?
  • Don’t make me to open the attachment. Include enough information in the email so that the recipient does not even need to open the attachments to figure out what this email is about. “The payment of $42 for your invoice XYZ has been made into the nominated bank account on 26-Apr-2018”. Something like this is easy enough to build in Dynamics 365 workflow and it would do nicely.

I’m sure there are other tips to ensure that your email is delivered and read but even following the simple points above will get the job done more often than not.

Facebook and twitter cover photo by NeONBRAND on Unsplash