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.

Tip #1106: Developer Masterclass

Calling for Dynamics 365 developers around the world but mostly in Europe! CRM Tip of the Day is proud to present an inaugural Business Application Developer Masterclass. Even though the acronym spells “BAD”, it’s going to be good!

WIthout further ado…

Dynamics 365 Business Application Developer (BAD) Masterclass

The new, Spring 2018 Dynamics 365 release is here with the new features, new developments, and new challenges. This is your first chance to get your hands on the new technologies and learn the new stuff before anyone else.

A rare opportunity to attend personal in-class training by yours truly, George Doubinski, founder of CRM Tip of the Day and CRM.Audio with the guest appearances by Scott Durow, Jonas Rapp and David Yack.

Who shall attend: For all you experienced Dynamics 365/CRM developers who want to take your skills to the next level.

There is a limited number of seats available so pick your favorite city and register today!

Would you like to convince yourself or your boss? How about 20% discount if you register by the International Labor Day, 1st of May?


Day 1

  • Introducing Masterclass and CRM Tip of the Day BAD Challenge
  • What’s new for Developer
  • Advanced Data Modelling + Challenge + Work time
  • Form Scripting Updates & TypeScript + Work time
  • Virtual Entities + Work time: Virtual Entity Custom Provider
  • Flow vs Logic Apps. PowerApps Canvas vs Model
  • Group work time

Day 2

  • Authentication Essentials + Work time
  • Azure Building Blocks Overview
  • Azure Functions + Group work time
  • Logic Apps + Group work time
  • Cognitive Services + Group work time
  • Developer Challenge Wrap up

Note: Agenda is subject to change

Tip #1105: Replacing the standard country text field

Country fields in D365 are text fields. The reason they are text fields is that that’s how it works in Outlook, and since addresses for contacts in OUtlook synchronize with D365, they are text fields in D365.

Many companies that use CRM have replaced the country and state fields with option sets or lookup fields; however, there are some considerations:

  1. Outlook synchronization: keep in mind that contacts tracked in Outlook will create contacts in D365, and contacts updated in D365 will synchronize to Outlook, if you remove the text field and replace it with an option set, contacts synchronizing with Outlook won’t show the country, and contacts tracked in Outlook will update the text field, resulting in a country not being displayed on the contact form in D365.
  2. More addresses: Addresses in D365 don’t actually live on the account or contact. They live in the customer address entity, which is called “more addresses” in the record navigation bar. Just because you add a custom country option field to the contact form won’t make the same option set field be populated in the customer address record.

Probably the easiest solution is to add the country option set and have a process update the standard text field with the value selected. This gives you a standard list but ensures that the standard country field is populated so it is populated in the address table as well as the contacts synchronized to Outlook. This doesn’t give a complete answer for contacts tracked from Outlook—the country option set would still be blank for these contacts, but you could create a cleanup batch job that updates these contacts that don’t have a country selected in the country option set.

Tip #1104: If without if

(The chart fortnight by Ulrik “CRM Chart Guy” Carlsson is over but I’m sure he’ll be back! – t.j.)

Sometimes we need to set the value for a field but only if it does not exist, e.g. user did not bother entering it. Like topic for a lead. I’ve seen the implementations where business asked to make it optional and set default to the lead name.

The first instinct is to do something conditional like:

if lead topic does not have value then
   update lead with a made up topic

Update lead conditional
Stacked approach works quite well in this scenario as “if without if”, i.e. update topic to itself otherwise use made up default:
Update lead implicit
The update is now can be bundled with some other manipulations, saving an extra update call but one thing to be aware of that it is unconditional and will trigger both workflows and plugins if any are registered on update of the field (topic in our sample).

Tip #1103: Chart styling cheat sheet

This post concludes chart week fortnight on CRM Tip of the Day. Thanks to Ulrik for these great tips.

It isn’t always obvious where to go in the chart XML to make changes to certain areas. We’ve created this handy cheat sheet so you can see where to go to change what in the chart.


Besides the chart type for the series, you can set

  • Color of the series
  • Custom text for the legend
  • Visibility in legend
  • Label and formatting of each data point
  • Borders on the bars/columns

Series CustomProperties

Special properties specific to the chart type chose for the series.

  • Label positioning (i.e inside/outside/left/right/etc.)
  • Width of bars/columns
  • Drawing styles (make bars look like wedges or cylinders)
  • For pie/donuts and funnel charts there numerous custom properties


Background colors and borders


The axis has the most properties. Here are some of the most commonly used.

  • Custom Axis Title, font size and alignment
  • Max and Min values for the axis
  • Line of axis width, color, and style
  • Interval between values on axis
  • Crossing if you need a break different than zero (useful for survey results)

Axis LabelStyle

Value formatting for the axis


Notes and comments to place on the chart in a specific place.

Tip #1102: Use hatch style in your charts and dashboards if you have color blind employees

One of the silent minorities in business are color blind people. Since dashboards rely on color coding to tell the different series apart, decoding those charts can be challenging for some users. Now, the palette of colors that comes out-of-the-box are generally chosen so people who have a form color blindness will still be able to distinguish the series, there can be situations where you need more than that.

About 4.5% of the population are color blind which equates to roughly 14.5 million Americans.

Imagine some of your users see your charts like this.

The quickest way to edit this is by using the Advanced Chart Editor for the XrmToolBox.

Open your chart and click on the visual editor.

 Navigate to the series and find the BackHatchStyle property and select a style. Do this for one of the series, or multiple if you have more than two.

Save and update the chart.

Now the users can distinguish between the different series based on the pattern.

(Facebook and Twitter cover photo by Anthony Menecola on Unsplash)

Tip #1101: Add a scale break to charts

Whenever you have a chart that combine very high and very low values, it can be difficult to assess individual columns. For these situations, you can add a scale break to the chart.

Adding a scale break gives you a better view of how the comparative segment are doing against each other, but you will lose some detail on how those segments are positioned in context of each other. Make sure you are only using this feature when relevant.

As usual, we will bypass the export, manual editing, and the import of the chart XML and just open the chart in the Advanced Chart Editor for the XrmToolBox.

Right click on the axis where you want to apply the scale break. This would almost always be the Y axis.

Insert the scale break.

In theScaleBreakStyle node options make a selection in the following settings.

Not all the settings are required, but make sure Enabled is always set to “True”.

Remember to click Save and the update the chart.

Scale breaks are great for emphasizing differences for similar values within a mixed set. If you have a set of data in a bar or column chart where all the values are very high with subtle, but important variations you can start the axis at a value that is not zero.

Instead of adding a scale break to the Y axis, find the property called IsStartedFromZero and set the value to False.

Then save and update the chart.

Now you have a chart where the variations in the values are easier to identify. It is possible to set your own starting value on the axis directly, but this property automatically identifies the best starting value. While you could use this property in conjunction with the scale break, it would be poor practice in most cases as the properties serve different purposes. When using the IsStartedFromZero = False option, we recommend either emphasizing the values on the axis itself, or adding an annotation notifying the user that this axis has a different starting point.

(Facebook and Twitter cover photo by Rainer Krienke on Unsplash)

Tip #1100: Consider using parallel workflows instead of if-then statements

(The chart fortnight by Ulrik “CRM Chart Guy” Carlsson is interrupted again. Well, we I did mess up the tipping sequence so you’ll see the same things reappearing during the week in case you went off the grid over the weekend. Back to you, Leon. – t.j.)

I am not a fan of the term ‘citizen developer’ when it is used as a synonym for ‘undisciplined developer’. There are plenty of ‘real developers’ who code for expediency, rather than for longevity. Whether we are using workflows, ‘real’ code or Flow, there are good habits we can adopt to make our work easier to manage and maintain.

This tip comes from discussions with my colleague Olena ‘disciplined developer’ Grischenko in regards to portal forms and workflows. Essentially, in this scenario, a form was submitted via the portal and then a workflow massaged the resulting record, as required. Initially we only had a few forms so it was tempting to have one workflow do the work.

If form is 'x' then do this

If form is 'y' then do that

If form is 'z' then do the other

If this, that, and the other were identical, we could call a child workflow or action, but this cannot be guaranteed.

The problem is there is a good chance we will be adding more forms in the future. It is easy to see that a few dozen forms later we have a really long workflow which we have to trawl through to find the steps which relate to our form. It will make debugging difficult and, if we are running an agile project with multiple developers working on different form stories, they could tread on each others’ toes as they all modify the same, long workflow.

The alternative is a workflow per form. Each ‘if’ becomes a different workflow. While this means dozens of workflows instead of dozens of ‘if’ conditions, we can manage this more easily through naming conventions and the search tools we have for views of records. It also means we can put a small change in a solution file instead of loading a huge workflow with only a tiny tweak (or multiple tweaks for multiple stories which we have to test en masse).

Using multiple, small workflows is easier to read, easier to manage, and we stop the developers from clashing with each other. A good, disciplined approach.