Use synergy of imagination and knowledge to stimulate brands' progress and give birth to their technology revolution.
Even if it seems too obvious to write about, Email Configuration in Microsoft Dynamics can pose a real problem for CRM users. This is because when you click on the email field in an Account or Contact form within the system, standard Dynamics 365 functionality opens only the default email dialog.
But what if you don't want to open the Outlook Desktop App or want to open another email service? When there is no out-of-the-box solution to configure, this becomes a challenge and we've successfully faced it.
We wanted to deploy this functionality for a number of reasons.
And before launching our journey we surfed through many forum threads to figure out what other dev trailblazers had already done and what issues they had.
First, we ran into an Ask Different platform discussion:
Then we looked at a Pro Webmasters talk:
So we grasped that the field with the Email entity in CRM invokes the mailto scheme on the client. It determines the schema for email addresses in SMTP (Simple Mail Transfer Protocol).
The mechanism that activates the mail link requires a default mail client to be configured on the user’s computer.
Thus, everything rests on local client settings, which software engineers try to edit in entirely different ways.
Also, we understood that there is going to be a difficulty with the call to Outlook Web App. This is not a physical application, and, therefore, special plugins or separate call commands are needed exactly for this synchronization.
Another concern posed that MS Dynamics 365 didn't offer functionality for tracking the OnClick event by field. To activate it we had to perform the following:
But this method had two disadvantages.
The first one is that it obliged the user to use Google Chrome as the default web client. But, actually, many people don’t like this browser, and, besides that, Apple users will certainly not benefit from this approach.
The second is that it was still a client-place edit. And just imagine that if you have to add such instruction for hundreds, for thousands of users...
What we needed was a much simpler, cohesive approach. And we found one.
So, we decided to create our own control (yeah, PCF (PowerApps Component Framework)), with our own onClick-event and transitions.
Even though it was significantly easier and cheaper to write all the necessary actions and transitions right in the custom control code but, we went the extra mile and decided to create a separate functionality (web resource) with a transition option, and another functionality (custom control) will call the web resource we need.
Since we had used React, this helped us install all the necessary components and events, including reacting to OnClick across the field what we think is right.
We created a web page from which the required transition will be made (to a desktop client, to a web application, or simply to open an Email card in Microsoft Dynamics CRM):
let email = Xrm.Page.getAttribute(“emailaddress2”).getValue();
let lastname = Xrm.Page.getAttribute(“firstname”).getValue();
// Web app:
let url = “https://outlook.office.com/?path=/mail/action/compose&to=” + email + “&subject=Test Email&body=Dear ” + firstname;
// Desktop app:
let url = “mailto:” + email + “?subject=Test Email&body=Dear ” + firstname;
// Email CRM
We needed to put our control on the form:
We set the necessary attributes (the name of the web resource and the method that will be called). Saved, published, and checked:
As you click on the mail icon, it invokes a custom web resource (form) with three suggestions on how to proceed, so, now users can choose the most preferable email server.
With the help of child attributes, you can send any parameters of the contact card (or account, lead, etc. – no matter what entity you place this functionality on) to call mail.
And, now, you can synchronize email fields in MS Dynamics with any email service of your choice!
Create your free account to unlock your custom reading experience.