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.

Shortcut

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

Tip #1109: Add variables to your workflow (when Actions don’t work)

Back in Tip #736: Add variables to your workflows, George ‘bringing discipline to the rest of us’ Doubinski suggested the excellent Tip of using an Action to simulate a variable in Workflows. I went to use this Tip this week for a lookup and, to my chagrin, found there is an exception to the Tip. Namely, if the output argument is a Lookup (or Option Set), the Action will NOT be available to the Workflow. It simply does not appear in the list. If you have a friendly developer nearby they can create a ‘wrapper’ with a custom Workflow activity but, as my colleague Lachlan ‘Cabin Boy’ Wright pointed out there is a simpler, codeless way. Sometimes the obvious answers come to us through the eyes of the innocent.

While it is possible to define an Input or Output argument as an EntityReference or Entity (think pointer or memory reference if you come from a C background, or GUID vs record, although for the simple purposes of configured Actions I am yet to find a practical difference between the two argument types), this renders the Action useless for the reason mentioned above. The alternative is to use the Workflow’s record, that is, the record the Workflow is running in the context of. So, if you need a lookup ‘variable’, create a lookup in the entity and store the value there. Workflows can be a bit tricky in terms of running their steps in order so be careful but it is a simple workaround to an annoying problem.

Tip #1108: Good news for Australian and New Zealand partners

I am not even going to pretend that I can match the eloquence level of some Microsoft announcements so I’m going to copy this one verbatim. In short, if you are a Microsoft Partner with expertise in Azure and/or Dynamics 365, and you deal with the government(s), read and take action.

We are excited to announce that our new Azure regions in Canberra are now available. These new regions are designed to serve the needs of Australian and New Zealand Government, critical national infrastructure commercial organisations and their trusted suppliers. We have entered into a strategic partnership with Canberra Data Centres to deliver these new regions, unlocking the potential for digital transformation and innovation.

Additionally, the Australian Signals Directorate has upgraded the certification of 25 Azure and 10 Office 365 services to Protected status, making us the first global cloud provider to achieve this certification level in Australia. Our new regions also offer 100% ANZ supply chain assurance, high availability and disaster resilience, and the specialised connectivity and colocation characteristics necessary to support the mission-critical data requirements of our customers.

We operate a process for whitelisting Azure subscriptions to deploy into the new Australia Central Regions. This is a two-step process to firstly authorise eligible Australian and New Zealand organisations, and secondly to enable these organisations to provide Azure Subscription IDs for whitelisting.

Alongside this and aligned to our launch, we are pleased to announce our Azure Skills Training Program designed to help build the fundamental skills needed to enable cloud adoption. Through July, we will offer a series of highly subsidised, in person and instructor led training courses in all capital cities across Australia.

If you are interested in finding out more, here are some next steps:

  • Register for one of the courses available in the Azure Skills Training Program
  • Download the Modernising Mission-Critical Applications whitepaper
  • Check whether your organisation is eligible and request to be whitelisted for access to the Australia Central Regions here

Visit Azure.com/Australia to find out more about these new Regions, to check your eligibility, view our launch partners, and learn how to get started.

Tip #1107: Do not extend system users

Dynamics 365 Online is a great platform for extending almost anything including system entities like systemuser. While it’s easy to customize this entity to add some simple additional information about the user, e.g. charge-out rate, induction training completion date, latest lasertag achievement, etc, it may be not a good idea, after all.

The problem is that systemuser entries and, specifically, their status, are controlled outside of Dynamics 365, by Azure Active Directory. During the routine updates it may cause some drama if, for example, a Space Invaders score needs to be corrected for someone who no longer has Dynamics 365 license and is therefore disabled. Data migration between the systems would be even more challenging with the only solution being to temporarily grant licenses, wait a bit for them to take effect, update what’s needed and then remove the licenses. Possible to automate but rather tedious and may require some extra licenses.

Instead, keep additional information about the users in a separate entity with 1:1 relationship to systemuser. Updates to inactive records? Easy done. Migration of the data for 700 disabled users? No problem. And if you ever wanted to keep some of the private information like their hobby or last year bonus, you can apply some Dynamics 365 security juice.