Sonoma Partners Microsoft CRM and Salesforce Blog

D365 v9 Unified Interface Icons

If you’ve had a chance to play around with the new release of Dynamics 365 and dove into the new Unified Interface, you might’ve noticed that custom icons (whether entity or ribbon buttons) are all defaulted to a puzzle piece. This is due to a new Vector image format (SVG) that D365 supports in the latest release. The standard web interface will use the old image formats and Unified Interface will only use the SVG format so you will need to provide icons in both image formats if you plan on using the Unified Interface.

So how do we update our icons? First, create a web resource like normal and you will notice a new Type of Vector format (SVG). Select this and upload your SVG icon.

image

If you’re wondering how to create an SVG icon, I highly recommend SyncFusion’s Metro Studio app. There is a lot of great icons and you can easily edit them to how D365 expects and export them to many different formats.

In Metro Studio, find an icon you like and set the Height and Width to 32px with a padding of 0px. Select the transparent Background Shape (checkered box on the far right). For entity icons you will want to have an Icon Color of black (#FF000000) and D365 will automatically set the color to how it should be. I have noticed however that currently ribbon button icons will not automatically set the color so you should set the Icon Color to white (#FFFFFFFF) for ribbon icons.

image

Once you have the right settings, click Export and select Scalable Vector Graphics (*.svg) as the Save as type.

image

Now that you have your SVG icon uploaded as a web resource, head to your Entity customization and select “Update Icons” at the top. You will be able to upload entity icons like normal but there will now be a second tab called “Unified Interface” where you can select your new SVG icon.

image

Now we can check out our new icon in the Unified Interface. Use the App selector to navigate to an app where Unified Interface is enabled.

image

Now your custom entity icon will display correctly instead of using the default puzzle piece icon.

image

With custom ribbon buttons, as stated earlier, currently D365 does not automatically change the foreground color so we need to set it to white to be consistent with the native UI. Using the wonderful Ribbon Workbench, just set the ModernImage property of your button to your new SVG web resource.

image

Our new SVG icon in the Unified Interface:

image

Now your icons are all set in both the Web and Unified Interface!

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Implementing Machine Learning in D365 – Part 2

This post is the final part of our two-part series on Implementing Machine Learning in D365. Head here to read part one if you haven’t been following along yet.

In part one, we built an Azure Machine Learning (AML) algorithm against our Opportunity data in D365 to come up with a probability that the Opportunity will win. In this post, we will use AML to generate a web service for us and then we will use Microsoft Flow to retrieve the probability and update newly created Opportunities with the value.

Within AML, after you successfully ran the experiment, select Set Up Web Service –> Predictive Web Service

image

Once it is finished, you will then have to click Run to go through the experiment again. Once that is finished you can click Deploy Web Service –> Deploy Web Service [New] Preview. You will have to create a new Price Plan (fortunately there is a free one with 1,000 transactions) and then click Deploy. Once it is deployed, you will want to click Use Web Service. On the next page you will want to make note of the Primary Key and Request-Response values as we will need this shortly.

image

Next, head over to Microsoft Flow and sign in with a Microsoft account. Click “Create from blank” and then search for the “When a record is created” for D365 trigger.

SNAGHTML387eecc

You will need to authenticate to D365, select your organization and then select the Opportunities entity.

image

Click + New step –> Add an action. Search for and select the “HTTP – HTTP” connector. We will use this to call our AML web service that we just deployed earlier. Set the Method to Post and the Uri to the value of the “Request-Response” that we noted earlier from AML. Next, add a header and set the key to ‘Authorization’ and set the value to ‘Bearer xxx’ where ‘xxx’ is the value of “Primary Key” that we noted earlier from AML. Then add a new header value with a key “Content-Type” and value “application/json”. Lastly, set the Body to the following:

{
    “Inputs”: {
        “input1: [
          {
            “description”: <description>,
            “estimatedvalue”: <estimatedvalue>,
            “statecode”: 0
          }
        ]
    },
    “GlobalParameters”: {}
}

Using the dynamic content helper on the right, replace <description> from the Body by selecting Description from the list of dynamic content. Do the same for the <estimatedvalue> so that the whole HTTP action looks like the following screenshot:

image

Next, click + New Step –> Add an action and select Parse JSON. Using the dynamic content helper, set the Content field to the Body from the HTTP action. Set the Schema field to the following text:

{
            "type": "object",
            "properties": {
                "Results": {
                    "type": "object",
                    "properties": {
                        "output1": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "estimatedvalue": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "statecode": {
                                        "type": "string"
                                    },
                                    "Scored Labels": {
                                        "type": "string"
                                    },
                                    "Scored Probabilities": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "estimatedvalue",
                                    "description",
                                    "statecode",
                                    "Scored Labels",
                                    "Scored Probabilities"
                                ]
                            }
                        }
                    }
                }
            }
        }

image

This will help parse the response from the AML web service call so we can get to the actual probability value that is returned.

Lastly, click + New Step –> Add an action and select the “Update a record (V2)” for D365. Set your organization and the Opportunities entity again. Then using the dynamic content helper, set the required fields to the respective values from our first trigger from D365. For the probability, I created a custom Decimal field called Predicted Probability. This field will show up in the “Show advanced options” section in Flow. Click that and find the Predicted Probability field and set the expression to the following:

mul(float(body('Parse_JSON')?['Results']?['output1'][0]['Scored Probabilities']), 100)

This expression is using the Parse JSON action we added to get to the Score Probabilities value from AML, converting it to a float and then multiplying by 100 to show as a percentage in D365. The “Update a record (V2)” trigger should look like the following screenshots:

image

image

Now you can save the flow and make sure the trigger is set to “On”. Now in D365, we can create a new opportunity. I set the Description to “Wine” with an Est. Revenue of $90. Back in Flow, you can check the Run History and make sure the Flow ran and was successful. It may take a minute or two for it to run.

image

Once you see a successful process in Flow, refresh your D365 Opportunity and you should see the Predicted Probability updated.

image

Now we have a complete round-trip from getting the data out of D365 to train it and then pushing the predicted probability back into D365. For existing records, you will want to build a process to retrieve them all and call the AML web service for each one.

Azure Machine Learning has many different algorithms (here is a nice cheat sheet) for all different types of business processes. This is just one example and will hopefully give you an idea of what you can accomplish in your own organization. If you have an questions or are interested in enhancing your organization with machine learning, contact us.

Happy Machine Learning!

Topics: Integrations Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Implementing Machine Learning in D365 – Part 1

Machine Learning is the latest hot topic and for many good reasons. Being able to take a manual, sometimes inaccurate data point and transforming it into an automated and consistently accurate one, has huge advantages. Take for example the probability that an opportunity will close. It is up to your salesperson to input this data and you relying on it to be accurate.  With machine learning, we can automatically provide this data point and have it be consistently accurate based on historical data.

In this two-part series, I will be walking through just that, how to implement Azure Machine Learning (AML) that will provide the probability that an opportunity will win. I will be using a very simple algorithm with only a couple factors as an example. It will be up to you to come up with the factors that matter for your business and make sure your CRM has that data, in order to come up with an accurate opportunity probability.

I will be using D365 Online and the first thing we will want to do is setup the Data Export Service so we can replicate our data into an Azure SQL database which AML can easily connect with. If you haven’t set this up yet, head here for a complete guide on how to set it up. For this walkthrough, you will only need to sync the Opportunity entity but if you want to expand your factors further, you will most likely want to sync other entities.

Note: If you are on an on-premise version, you can utilize SSIS to replicate on-premise CRM database to an Azure SQL database.

Next, go to your Azure Portal, create a new resource and search for “Machine Learning Studio Workspace”

image

Once everything is setup, you can navigate to the new Machine Learning Studio workspace and click “Launch Machine Learning Studio”.  This will take you to a separate website where you will need to sign in using your Azure credentials.

image

Then create a new blank experiment:

image

You will then see a blank canvas where you can drag and drop different components. The first thing we will want to do is search for “Import Data” on the top left and drag the “Import Data” component onto the canvas.

image

Then, highlight the Import Data component and click the “Launch import Data Wizard” button on the right. Select Azure SQL Database and enter the right settings for your environment. Next, enter this SQL query:

select
    cast(estimatedvalue as float) as estimatedvalue,
    description,
    CASE 
       WHEN statecode = 2 THEN 0
    END  as statecode
from opportunity
where statecode = 1 or statecode = 2

In this query, we are retrieving the estimated value and description of the opportunity. With my sample data, the description is acting more like a “type” of opportunity. The values in this field in my org are either “Beer” or “Wine”. Estimated value and description are the two factors that we are using to determine if the Opportunity is Won or Lost. In a production scenario, you will most likely want to capture and use more data points for an accurate opportunity probability. Factors such as how long the opportunity sits in each stage, how many activities are regarding the opportunity, or maybe even the salesperson that owns the opportunity.

The first thing to note with the query is that AML currently doesn’t support decimals so we need to cast estimatedvalue as a float.

cast(estimatedvalue as float) as estimatedvalue

Next, we’re going to be using the Two-Class Boosted Decision Tree algorithm which requires us to pass it a 0 for negative and 1 for positive. We want to label the Lost opportunities as negative and the Won opportunities as positive so we use a SQL CASE statement to set the statecode value for Lost (2) as 0. The statecode value for Won is already 1 so we are good there.

CASE 
       WHEN statecode = 2 THEN 0 
END  as statecode

Lastly, we only want to return Won and Lost opportunities as we are building the AML model based on what is already Won or Lost since that is what we are trying to predict.

where statecode = 1 or statecode = 2

Next, search for the “Split Data” component and drag it onto the canvas. Then, connect the Import Data and Split Data components together.

image

Best practice with machine learning is to split the data so that most of the data is used to build the model and the other piece of data is used to evaluate the model to see how accurate it is. That is what the Split Data component is for. You can play around with the settings to split the data how you like.

Next, drag the Two-Class Boosted Decision Tree component to the left of the Split Data component.  Then, drag the Train Model component under the Two-Class Boosted and Split Data components and connect the Two-Class Boosted to the left point of the Train Model and the Split Data to the right point of the Train Model.

image

Highlight the Train Model component and on the right-side and click the “Launch column selector” button. Next, enter “statecode” and click the checkmark.

image

This is taking a subset of the data (based on the Split Data component) and applying the Two-Class Boosted Decision Tree algorithm to it using the statecode parameter to build a model based on the Won and Lost opportunities.

Lastly, drag the Score Model and Evaluate Model components onto the canvas and make the connections like so:

image

This will run the other piece of data from the Split Data component and run it against the trained model and determine the score, which in our case is the opportunity probability. Then it will take that score and evaluate it to provide metrics on how well the model is.

Now click the Run button at the bottom which will process each component. Once it is finished, you can right-click Score Model and select Scored datasets –> Visualize. This will show you your data with the score columns applied. Scored Probabilities is the percent that the machine believes it is the positive value, which in our case is a “Won” opportunity. The Scored Labels column is the value of 0 or 1 for Lost or Won opportunity. If Scored Probabilities is greater than 50% then Scored Labels will be set to 1, otherwise it will be 0. More information on the Score Model can be found here.

image

Now right-click Evaluate Model and select Evaluation results –> Visualize. This will display a chart of how accurate your model is with data points on the accuracy. Based on your results, you can tweak the settings in the other components or bring in and remove factors and re-evaluate the model to get an accuracy that you are comfortable with. More information on the Evaluate Model and what the different data points mean can be found here.

image

That concludes the first part of our series. Now that we have a trained model with a high accuracy, in the next part of the series, I will show you how to generate a web service that we will use to retrieve the probability prediction and update D365 with the data. The best part is, we can use the power of Microsoft Flow to do all this without any code…stay tuned!

Topics: Integrations Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Dynamics 365 Multi-Select Fields

One of the most asked for features from our customers is “does Microsoft Dynamics CRM have multi-select fields?”  Well, now we can safely answer “Yes” to that question, as the new version of D365 version 9.0 will have this in the product.

Note that I’m calling this D365 version 9.0, as this was originally the Spring release of D365, then July 2017 release of D365, and now since July has come and gone, it’s not clear when the release will drop.  However, we do know that it’ll be the next major version v9.0.

Multi Select Pre D365 v9.0

Before the release of D365 v9.0, there were many ways to get around the fact that Microsoft CRM did not have multi-select fields built in:

  • Custom 1:N entities where each child record represented a selected value
  • Custom N:N relationship where linking records in each entity together represented a selected value
  • Multiple custom fields on the entity where making selections in each field represented a selected value
  • Custom 3rd party solution such as Sonoma Partners multi select tool for D365

These solutions came with their own pros and cons, and neither was 100% the way our customers wanted the solution to work.  Some came with a heavier investment, some came with a less than ideal user experience for either adding values in CRM or importing data in bulk, etc.

However, all that changes with the v9.0 release of D365.

How Does It Work?

To use multi-select fields in D365, users will configure them just as you would configure any field.  Microsoft has introduced a new field type called “MultiSelect Option Set” that you can select when creating a new field.

image

All properties of fields that exist for the current field types, also exist for this new multi-select field type (e.g., enabling auditing).

Note that you can also make a multi-select option leverage a global option set and therefore you can have multiple multi-select option sets using the same list of values.  There isn’t a difference between global option sets that can be used for single-select or multi-select option set fields – it’s the same list of available global option sets to use for both.

System Administrators and System Configurators can add the multi-select field to forms and views, just as you would any other field.

How Does It Look?

When you have a multi-select option set on a form, and click into the field, you’ll initially see a slim dropdown appear with no values with the text “enter text here” which will allow you to start typing and then will display values that match the text you entered.

image image

Alternatively, if you don’t want to start typing to see values that match your text, you can click on the dropdown arrow on the right side of the field to display all values.  This is someone of a pain as it requires two clicks to see all values in a multi-select option set, whereas for a single-select option set still requires a single click to see all values.

image

image

As users start selecting values by a clicking the checkbox, the values appear above the drop down with a little “x” on each value where a user can click on it to remove that value (or just uncheck the checkbox).  The value you select first drives what value appears first in the list above (it’s not in alphabetical order).

image

When done selecting values, simply click somewhere else on the form, and you’ll see your values selected semi-colon delimited.  The values, once select, now appear in alphabetical order in the field.

image

When viewing the data in a view, you’ll see the values selected semi-colon delimited as well.  Also note that view filtering is supported.  Therefore, users can select values to filter the records with as you would with a traditional single-select option set.  However, with a multi-select option set, when filtering, records are returned if any value selected to filter with, matches at least one value selected for the multi-value option set.  In other words, if you select a value to filter records with that is contained in a record, and select a value that is not contained in that same record, the record will still return after filtering because it met the criteria that at least one value existed in its field.

image

And what about editable grids (recently released in December 2016)?  Yup, multi-select option set supports those as well!

image

A new “Contain Values” operator was also added to Advanced Find.  When this is selected, records are returned where ANY of the values selected are contained in the field for those records (think of this as an OR statement).  The “Equals” operator only returns records where there’s an exact match to the values selected in Advanced Find (think of this as an AND statement).

image

Technical Details

There are a few additional details to note about the new multi-select field that will be released with v9.0 of D365.

  • You cannot convert a regular existing single-select option set field to a multi-select option set field at this time.
  • Multi-select option set fields cannot be a calculated or rollup field (single-select option set fields can be a calculated field).
  • Multi-select option sets support the web client, unified interface, advanced find, FetchXML, Platform SDK, and Client SDK
  • There is full platform support to use SDK messages for retrieve

Additional Resources

As mentioned earlier, this is one of the most sought-after features that is finally making its way to the product, and we’re excited for its release.  For additional information on this feature, along with what else is coming with v9.0, check out Microsoft’s documentation.

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Dynamics 365 - Learning Path Authoring Guided Tasks

In a previous blog (Learning Path Authoring Basics), we introduced Learning Path Authoring and the Content Library.  As stated previously, Guided Tasks are a step-by-step guide driving users through common or new tasks.  They’re also a great way to ensure users follow a consistent process to completing tasks throughout your organization, and work well as supplemental training after an official training session in which you run new users through your CRM deployment.

Guided tasks can include links, videos, and other content in your steps (or bubbles) to help your users become familiar with your CRM deployment.

There are two main steps for creating a Guided Task:

  1. Define how the Guided Task should be triggered and assigning roles to which the task applies
  2. Use the visual Flow Editor to drag and drop steps/bubbles that the users will see as they work their way through the task.

Define How the Guided Task is Triggered

You first need to go to the page in Dynamics 365 where you want your Guided Task to appear.  This is a small but very important step you must take BEFORE going to the content library to create your Guided Task.

For example, I wanted to create a Guided Task about how to create a new Contact.  Therefore, I had to navigate in Dynamics 365 to the Contacts main grid, and then went to Settings –> Training –> Content Library (or display the Sidebar and click on the Content Library icon from the Sidebar that pops out).

After the Content Library loads, click on image_thumb1 to open the dialog to start entering in your Guided Task details

image_thumb7

The following pieces of information should be collected as you start creating your Guided Task:

  • Disable this guided task:  If checked, this Guided Task will not appear to users.
  • Make this an error guided task:   If checked, this Guided Task will only appear to users if there is an error with other Guided Tasks associated with the page from being loaded (e.g., lack of security permissions for the logged in user).
  • Name:  This is the name for the Guided Task.
  • ClientWeb client, Mobile apps, or Interactive Service Hub are options you’ll see based on whether you’re connected to the mobile app interface or Interactive Service Hub when you’re creating the Guided Task.  Remember, it mattered where you came from before you clicked Content Library before you clicked image_thumb10 as that’s where the task will appear.
  • Form factor:  This depends on the Client you selected.  Web will allow you to select Desktop or Tablet.  Mobile apps will let you select Tablet.  And Interactive Service Hub will let you select Desktop.
  • Guided task opens when:  Select whether you want the Guided Task to appear when a Link is Clicked on a Sidebar, or when the Page Loads.
  • Lifecycle stage:  This is an internal use only setting and can be ignored.
  • Dynamics 365 security role:  Select the security role(s) that you want the Guided Task to be displayed for.  If a user is assigned to more than one security role, the Guided Task will appear only for the role with the highest precedence (as described in our previous blog Learning Path Authoring Basics).
  • Status:  The status which remains at Draft until you publish the Guided Task.
  • Advanced Options:  Note: These only appear after you save the Guided Task:
    • Make this error guided task:  This was described above.
    • Supported Languages:  Languages that this Guided Task supports, as well as used for import and export.
    • Author:  The creator/author of the Guided Task.
    • Tags:  Tags can be added to assist with searching for content in the Content Library as well as categorizing your content.
    • App Version:  The Dynamics 365 application version associated with the content.
    • Control Version:  Sets the version of the content.
    • Authoring Repository:  The Authoring Group (organization) for the content.
    • Publishing Environments:  The publishing group(s) (organizations) for the content.

When you’ve completed defining the how the Guided Task is triggered and details of the Guided Task, click on Save to move onto the flow editor.

Flow Editor

After you click on Save on your Guided Task, you’ll automatically be taken to the Flow Editor. 

image_thumb15

You can add a Title to your Guided Task which will be displayed to the end users as they navigate through the Guided Task.

You can also select whether to show fixed ID controls only.  Controls with a fixed ID are outlined in green, and those without are outlined in blue when you drag the tile to pin it to the UI.  Pinning a step to a control without a fixed ID could mean that your Guided Task could break in future Dynamics 365 updates.  However, that will not be the case if you pin to fixed ID controls.

Click on Add New Step to add a new step, and select from one of the following options:

  • Step with Next button:  A step with a Next button allowing navigation to the next step.  The Next button will not display if this is the last step.
  • Step with User action:  Instead of a Next button to move to the next step, the user must click a UI element to continue to the next step.
  • User action with Next button:  This step has a Next button, but clicking the Next button simulates the effect as clicking the UI element to which the step is pinned.  This step can be a little confusing to users, and therefore I’d caution against using this often.
  • Learning Step:  This step can only be used at the end of a Guided Task flow.  It can be used to link to a Learning Path sidebar at the completion of a Guided Task.

Now to create a Guided Task that walks users through a series of steps to create a new Contact.  The first step is going to be getting the user to click on the New button.  I add a new “Step with User action” step, and drag it to the New button.

image_thumb131

image_thumb18

image_thumb24[1]

image_thumb28

I’ll pause here for a second to discuss the 5 buttons that appear on the right of the bubble/step.  From top to bottom those buttons are:

  • Move:  Clicking this will allow you to drag your step to a new UI element.  Not, however, that when I did this, the step name and step description I had typed were cleared out and I had to start over.
  • Content Type:  This allows you to change this from a Text step, to a Video step.
  • Placement:  You can specify where your bubble appears on the UI element control that you pinned your step to.
  • Copy:  Creates a copy of the current step pinned to the same UI element control with the same content, and adds it as a step directly below the current step in the Guided Task flow.
  • Save:  Saves your step.

After adding a few more steps, my Guided Task now looks like the following which walks a user through creation of a contact.

image_thumb32

At any point when you’re editing your Guided Task, you can click the Preview button which is at the bottom left of the Guided Task side bar that pops open from the left.

When in Preview mode, you can click on Check In to make your Guided Task visible to all Learning Path Authors, and then click on Publish so that the Guided Task changes can be visible to end users.

image_thumb36

image_thumb73

In addition to checking in and publishing from a single Guided Task, you can navigate to the Content Library and select one or many pieces of content and then select Manage –> Check In, and then Publish –> Publish.

After checking in and publishing the New Contact Creation Guided Task, it looks like the following when a user navigates to the Contact page.

image

image

image

image


Considerations

With this great feature allowing users to add customized help throughout the application, there are still some limitations / considerations to be aware of.

  • Learning Path is not supported in the native Dynamics 365 mobile app for phones.
  • When designing a Guided Task for the Web Client, The Tablet form factor refers to running the Guided Task in a web browser on the tablet (not the native tablet mobile app).
  • Creation of Guided Tasks is still finicky with where you are in it, where you click when you click certain buttons.
  • When I was using Internet Explorer 11, the Learning Path Authoring experience wasn’t ideal.  It seemed to work better with Chrome.  For example, when I clicked on a Guided Task bubble/step to edit it, the main Guided Task pane disappeared, and the bubble didn’t appear for me to edit. 
  • When entering in your steps (after dragging onto the UI) for Guided Tasks, remember to click the bottom Save icon to save the title / description / video you enter into the step.  You won’t get a warning if you don’t and your edits will be lost.
  • Before you Preview your Guided Task, make sure you navigate to the page that the task should fire from (e.g., the main Contact List view in my example above).
  • Moving the steps around within a Guided Task did not seem to work (to reorder the steps) so make sure you get your step order mapped out first before creating your Guided Task in CRM.

Final Thoughts

Learning Path has great potential, and the addition of the ability to create your own content makes this feature much more valuable.  I can see the need to create custom content for most of our customer deploys.

For more information on this topic, please see the other posts we’ve made about Learning Path:

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Dynamics 365 - Learning Path Authoring Sidebars

In a previous blog (Learning Path Authoring Basics), we introduced Learning Path Authoring and the Content Library.  As stated previously, Sidebars slide out from the right side of the application, and provide more information for users to quickly and easily get access to additional content.

Sidebars can include links, videos and other content to help users become familiar with a specific page or form that’s displayed.

There are two main steps for creating a Sidebar:

  1. Set the sidebar properties and assign security roles (that the sidebar should be displayed for).
  2. Add content to the sidebar.

Set the Sidebar Properties

You first need to go to the page in Dynamics 365 where you want your Sidebar to appear.  This is a small but very important step you must take BEFORE going to the content library to create your Sidebar.

For example, I wanted to create a Sidebar for Contacts.  To do this, I navigated in Dynamics 365 to the Contacts main grid and went to Settings –> Training –> Content Library (or display the Sidebar and click on the Content Library icon from the Sidebar that pops out).

After the Content Library loads, click on image_thumb80 to open the dialog to start entering in your Sidebar details

image_thumb85

The following pieces of information should be collected as you start creating your Sidebar:

  • Disable:  If checked, this Sidebar will not appear to users.
  • Make this an error sidebar:   If checked, this Sidebar will only appear to users if there is an error with other Sidebars associated with the page from being loaded (e.g., lack of security permissions for the logged in user).
  • Make this home sidebar:  Home Sidebars are shown when a user clicks the home button, or if the page the user is on does not have a Sidebar associated to it and the user clicks the Help question mark icon.  Each page can only have a single Home Sidebar.
  • Name:  This is the name for the Sidebar.
  • ClientWeb client, Mobile apps, or Interactive Service Hub are options you’ll see based on whether you’re connected to the mobile app interface or Interactive Service Hub when you’re creating the Sidebar.  Remember, it mattered where you came from before you clicked Content Library and image_thumb97 as that’s where the task will appear.
  • Form factor:  This depends on the Client you selected.  Web will allow you to select Desktop or Tablet.  Mobile apps will let you select Tablet.  And Interactive Service Hub will let you select Desktop.
  • Sidebar opens when:  Select whether you want the Sidebar to appear when a Link is Clicked on a page (including buttons), when the Page Loads, or Help Button is Clicked.
  • Lifecycle stage:  This is an internal use only setting and can be ignored.
  • Dynamics 365 security role:  Select the security role(s) that you want the Sidebar to be displayed for.  If a user is assigned more than one security role, the Sidebar will appear only for the role with the highest precedence (as described in our previous blog Learning Path Authoring Basics).
  • Template:  Sidebars can be in a Single Column or Two Column format.
  • Status:  The status which remains at Draft until you publish the Sidebar.
  • Advanced Options:  Note: These only appear after you save the Sidebar:
    • Disable Sidebar Header:  Disables the sidebar header.
    • Disable Sidebar Title:  Disables the sidebar title.
    • Disable Sidebar Footer:  Disables the sidebar footer.
    • Supported Languages:  Languages that this Sidebar supports, as well as used for import and export.
    • Author:  The creator/author of the Sidebar.
    • Tags:  Tags can be added to assist with searching for content in the Content Library as well as categorizing your content.
    • App Version:  The Dynamics 365 application version associated with the content.
    • Control Version:  Sets the version of the content.
    • Authoring Repository:  The Authoring Group (organization) for the content.
    • Publishing Environments:  The publishing group(s) (organizations) for the content.

When you’ve completed defining the how the Sidebar is triggered and details of the Sidebar, click on Save to move onto the content editor.

Add Sidebar Content

After clicking Save on the initial Sidebar properties page, you’re presented with a blank slate to start adding content to your Sidebar.

image_thumb[13]

In the top box, you can enter a title for your Sidebar that will appear for all users.  By default, you can see 4 sections added automatically, but you can add additional sections via the Add Section button, or you can remove sections by clicking the section header, and then clicking the trash can icon that flies out to the left.

You can have at most 12 sections in a Sidebar, and each section can have different content types (videos, text, external links, buttons, links to Guided Tasks, links to Sidebars, or links to pages in CRM) to help your users become familiar with the specific page or form that’s displayed.   Note that the Button content types give you the same 4 options as the List of Links content type, but by using buttons instead of hyperlinks (Guided Task, Sidebar, Page in the app, or External Webpage).

image_thumb[16]

image_thumb[20]

Just like with Guided Tasks, you can click on Preview to preview what your Sidebar will look like before checking it in and publishing it.

Here’s a Sidebar that I created around Contacts and how it looks in the designer.

image_thumb[24]

When you’re done creating your Sidebar, click on the Save icon at the very top left of the Sidebar in the designer.  Then navigate back to the Content Library, and select Manage –> Check in to make your Sidebar visible to all Learning Path Authors, and then click on Publish –> Publish so that the Sidebar changes can be visible to end users.  You can check in and publish multiple pieces of content at once from the Content Library.

After checking in and publishing the Contact Sidebar, it looks like the following when a user navigates to the page you set it up for (remember when I mentioned the page you navigated to the content library is important).  In this case, that’s the Contact main list view. 

Note that the Sidebar comes with a search bar that allows users to search for additional help and training.  This searches across Learning Path Content you’ve created, as well as external content outside of your organization that is publicly available.

image_thumb[35]

Considerations

With this great feature allowing users to add customized help throughout the application, there are still some limitations / considerations to be aware of.

  • Learning Path is not supported in the native Dynamics 365 mobile app for phones.
  • When designing a Sidebar for the Web Client, the Tablet form factor refers to running the Sidebar in a web browser on the tablet (not the native tablet mobile app).
  • Sidebars can have at most 12 sections.

Final Thoughts

Learning Path has great potential, and the addition of the ability to create your own content makes this feature much more valuable.  I can see the need to create custom content for most of our customer deploys.

For more information on this topic, please see the other posts we’ve made about Learning Path:

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Dynamics 365 - Learning Path Authoring Basics

With the release of Dynamics 365, Microsoft has added new authoring capabilities to the previously released Learning Path feature.  Additionally, head over to the CRM Roadmap site, or the CRM What’s New site to see more of the features that have recently gone live.

Learning Path, initially released in the Dynamics CRM 2016 Spring release, was a tool to provide rich contextual based training (walkthroughs, videos, and articles) directly inside of the application.  This was intended to allow new users of CRM (or users of a trial org) to get used to the application quickly.

One thing that was missing from that release, was the ability for organizations to author their own custom content.  That gap has now been filled with the December 2016 release of Dynamics 365, and we’ll discuss the authoring process in more detail below.  Please note, that with the initial release of Dynamics 365, this functionality is in it’s initial release, and you may run across some small hiccups along the way.  I anticipate this functionality to only improve with future releases.

Note, that Learning Path (including Authoring) is currently only available for Dynamics 365 Online.

 

Enable Learning Path Authoring

First off, you need to enable Learning Path Authoring in your organization.  To do this, navigate to Settings –> Administration –> System Settings.  Under the General tab, there’s a Set custom Help URL section where you can Enable Learning Path and Enable Learning Path Authoring.

image

You can enable Learning Path or customizable Help, but you’re can’t enable both at the same time.  Therefore, Use custom Help for customizable entities and Append parameters to URL must be set to No.

If you navigate to the Learning Path Content Library (Training –> Learning Path –> Content Library), you may get a message about not being in the O365 Learning Patch Authors security group.  If so, you must open the O365 Admin Center, click on Groups on the left, and select the Learning Path Authors group.  Click Edit in the Members area, and add the user that you’d want to be a Learning Path Author.

image

In addition to being in the Learning Path Authors O365 group, users will need to have a permission enabled on their Dynamics 365 Security Role.  They’ll need to have the Learning Path Authoring permission at the bottom of the Customizations tab.

You can navigate to the Content Library via the Site Map as instructed above (under the Training area), or you can get to it via any sidebar by clicking the Content Library Button.  You can open the sidebar by clicking the ? in the top right corner to the right of the Settings gear icon.

image

Content Library

Once learning path is enabled, you can navigate to Training –> Learning Path –> Content Library to see all the Guided Tasks and Sidebars created for your organization.  There are two types of Learning Path Content:  Guided Tasks and Sidebars.

  • Guided Task:  These bubbles walk users through elements of the application in a step by step fashion. They can be kicked off from a sidebar, navigating to a page, or clicking a link on a page.
  • Sidebar:  These are help instructions that fly in from the right side of the application.  These are displayed when the user clicks the Sidebar button or if there’s an error displaying the intended Sidebar.

From the Content Library, you can create a new Guided Task or a new Sidebar (we’ll go into more detailed explanation of creating a Guided Task and a Sidebar in a subsequent blog), but we’ll give a high-level introduction to the content library, and managing content in this post.

image

Clicking on the content name opens the content to be edited.  You can also take specific actions on content from here via the Manage menu, specifically:

  • Check in:  New content appears with a red lock next the name which indicates it’s checked out and not visible to anyone else.  You must check in content before publishing.
  • Delete:  Deletes the selected content.
  • Export:  Exports the selected content to a ZIP file so that it can be imported in another environment.
  • Import:  Imports previously exported content into this environment.

Content can be localized into the language the users have selected in their Dynamics 365 personal options.  This can be done by clicking the Localize button, and then either Export or Import.

Publishing

Before you can publish new content, you must first check it in.  After you check in your content, you use publishing environments to publish the content for the end user to use.

Publishing Environments are a collection of Dynamics 365 Organizations that you want to group together for use when publishing Learning Path content.  The organizations that are visible are those that are all visible in your O365 account.

To view and configure your Publishing Environments, navigate to the Content Library, then Configuration, and finally on Publishing Configuration.  From here you can view, edit, create, and delete Publishing Environments.  By default, a single Publishing Environment is created with the Unique Name of your organization.

image

After setting up your Publishing Environments, when you’re in the Content Library, you can click on Publish to publish content which makes the modifications made to content visible to end users.  When publishing, you can select one or many Publishing Environments to publish to.

image

A good best practice for publishing would be to create your content in a Sandbox first, and then you can publish to Dev/Test/UAT to test the content, and when it looks good, finally publish it to Production.

Security Roles

Learning Path Content is associated with Security Roles.  If users are associated to multiple security roles, they’ll see the Learning Path Content associated with all security roles.  If different content is created for different roles on the same Dynamics 365 page or screen, users will see the content associated with the role with the higher precedence. 

Navigate to the Content Library, click on Configuration, and you’ll see the roles and their precedence order.  From here you can click on Sync Roles to synchronize the Dynamics 365 Roles with Learning Path.  You can also click on the arrows to move the roles up or down in precedence, as well as click the trash can icon to remove the role from Learning Path (note that this doesn’t delete the role from Dynamics 365, but simply from the Learning Path designer to define how content is displayed to users).

image 

Additional Resources

The following additional resources are available to learn more about Learning Path Authoring.

Final Thoughts

Learning Path has great potential, and the addition of the ability to create your own content makes this feature much more valuable.  I can see the need to create custom content for most of our customer deploys.

For more information on this topic, please see the other posts we’ve made about Learning Path:

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Power BI Online Integration with Dynamics CRM On-Premise

Today's blog post was written by Hayden Thomas, Associate Developer at Sonoma Partners.

Integrating Power BI online with Dynamics CRM On-Premise is not currently supported natively. Recently we had a need to integrate a Power BI Report with a Dynamics CRM On-Premise environment, so we needed to create a custom solution to enable embedding reports and dashboards from Power BI into CRM.

Power BI natively allows reports to be ‘Published to Web.’  Doing this would allow us to simply IFrame the report on a Dynamics form or dashboard, but this makes it accessible to anyone who may have the link which is not very secure. This is unsuitable as the reports we’re looking to embed may have sensitive data which we want to make absolutely sure no one has outside access to.

In our case, we are connecting to Power BI through Azure. Azure uses OAuth 2.0 and Active Directory services for authentication. We need to be able to store:

  1. A Client ID that represents a connection to Power BI through Azure.
  2. A Tenant ID for our Azure Active Directory.
  3. An access token that will allow us to request a report from Power BI.
  4. A refresh token that will allow us to programmatically keep our authentication alive, so that we don’t need to continuously keep putting in our username and password.
  5. The lifespan of the authentication and the date-time we obtained it, so we can check if our current authentication is still good.

The Client and Tenant ID are the same for all of the users in our org, so we simply created a configuration record to hold these values.

The other fields will either be created for every user and we need to ask the user to enter their authentication to populate these fields, or we need to create a service account that can be authenticated in the background without the user needing any information on how the reports are being displayed.

Our solution used the second option. Our reports are shared amongst a group in Power BI. In order to have everyone log in and have their own tokens, it would require them to all be added to that group (and in turn, require everyone to have a Power BI Pro license). This also allowed us to just add the authentication fields to the configuration record, along with the service account’s username and password.

Powerbi brendan 1

Our next step is to make sure we actually have an app registered to our Azure AD that we can authenticate this user against. If we log in to dev.powerbi.com/apps, we can register one directly to ensure that it’s set up correctly. In order to make sure we don’t need to handle anything with redirect URLs, since we expect to move this around to different orgs without much issue, we use Native app from the App Type drop down, and for our redirect URL we use this link. For our case, where we only want to be able to read dashboards/reports, we only give it the read all dashboards and read all reports access levels. Once done, we can click Register App to obtain the Client ID we will use for our configuration record.

We have our app created, but haven’t yet given permission from our service account to the app to be able to log the user in programmatically. In order to give permission, we wrote a LINQPad script that does nothing but connect to the Client ID of our app, and allow the user to log in to give access.

Powerbi brendan 2

Running the script will pop up a dialog to allow a user to log into the App created with the specified client ID.

Powerbi brendan 3

In order to connect and display the report, we look to the Power BI documentation on how to show a report in an IFrame. https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-report-load-report-iframe/. We see that we need an embed URL and an access token. Since we need to send information to the IFrame after it’s already set, and because we want to be able to use different reports in different areas, we create an HTML web resource that’s got an Iframe in it, and set the frame contents accordingly using JavaScript.

Powerbi brendan 4

Excess code for styling and other libraries used in JavaScript removed for brevity.

The JavaScript in this page does a number of things. When the resource initially loads it parses the report ID and the group ID, in which the report is stored, from the query string. This lets us use the same web resource on the same page to load multiple reports. In the web resource properties on dynamics, we can set this report and group ID field accordingly in the custom parameters.

Powerbi brendan 5

It then triggers a custom action that takes in both of those parameters. The custom action triggers some plugin code that loads the configuration record, ensures the authentication is up to date, and then queries Power BI for the embed URL for that report.

For ensuring our authentication is up to date, we see if we have an access token or if our token has expired (based on the authentication lifespan and authentication obtained date time fields we have on our configuration). If we don’t have a refresh token, we need to use the password grant_type along with the service account username and password. (If we can refresh, we do something similar using grant_type refresh and the refresh token that we have stored in our configuration record. More details on Azure OAuth operations can be found here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-code). In this example, we deserialize into an AccessToken model class that’s described by the documentation above.

Powerbi brendan 6

With our access token, we can query Power BI for the reports which are shared with the Group ID we sent added as a parameter by doing an HTTP GET request against https://api.powerbi.com/v1.0/myorg/groups/GROUP_ID/reports with an Authorization: Bearer ACCESS_TOKEN header.

Powerbi brendan 7

This will give us a response that’s a JSON string which will be an array of all of the reports for the group. Each entry in the array will contain the report ID and the embed URL. There are additional fields, such as the display name for the report, but they’re unimportant for what we’re doing. We simply need to find the entry that has the report ID that we passed in, and return the embed URL and access token back to the web resource. Powerbi brendan 8

Once we have those fields in the client side, we can simply set the source of our Iframe to the embed URL we received, and post the access token to it.

Now we can see our Power BI report as an iFrame.  In this case we embedded as a Dashboard in Dynamics CRM.

Image5

Topics: Analytics Microsoft Dynamics 365 Microsoft Dynamics CRM

Dynamics 365 – Email Engagement

Continuing with our posts regarding the release of Dynamics 365, next up is the new Email Engagement functionality Microsoft has added to the core product.  Additionally, head over to the CRM Roadmap site, or the CRM What’s New site to see more of the features that have recently gone live. 

Email Engagement is the ability to see tracking statistics about emails that are created in, and sent out of Dynamics 365.   Or in other words, Email Engagement enables monitoring of activity taken by the recipient of the email.  Specifically you can monitor when the recipient:

  • Opened the message
  • Clicked on a link
  • Opened an attachment
  • Replied to the email

You also have the ability to schedule when the email should be sent based on when you think the most effective delivery time is for your message.  You can also set alerts to remind you when you should follow up on the email.  You can view additional information on Email Engagement from Microsoft via this link.

We’ll go into more detail in using Email Engagement below, but first lets discuss how to get it enabled.

Enable Email Engagement

In order to enable Email Engagement for Dynamics 365, you need to accept the Preview Terms and Conditions.  To do this, navigate to Settings –> Administration –> System Settings.  Then click on the Previews tab, and make sure you’ve checked off that you agree to the license terms, and enable Email Engagement.

image

On top of enabling the preview feature, you’ll also need to enable Server Side Sync for SharePoint and Exchange in Dynamics 365, and enable OneDrive for Business in Dynamics 365.

You’ll also have to enable document management for the Email entity, which can by done by going to Settings –> Document Management –> Document Management Settings.  Check the Email checkbox and you should be good to go here.

Finally,  you need to accept the Email Engagement terms and conditions in Dynamics 365 and set some other options (cards etc.).  This can be completed by going to Settings –> Relationship Insights.  With the initial screen, you’ll have to click on the “I have read and accept these terms and conditions” checkbox and click on Continue.  Then click on the Email Engagement tab, and click on the checkbox by “By enabling this feature, you consent to share your data…” and click on “Begin Setup.”

image

The setup process will then begin and could take some time, but once it completes, you’ll have to click on another checkbox next to “Turn on email engagement for your organization” and click on Save.  You should now be good to go to use Email Engagement!

 

Using Email Engagement

Note that Email Engagement only works for emails that are sent out of Dynamics 365 (versus emails sent from Outlook / Exchange that are tracked in CRM).

The first thing you’ll need to do is simply create a CRM email as you would normally.  However, now when you do so, you’ll see additional content on the email message in an Email Engagement section.

image

When new emails are created, they’re automatically followed.  You can click on the DON’T FOLLOW link to not follow this particular email.  However, there is a “Follow Email” field on the Contact that you can update to “Do Not Allow” and when doing so, the next time you create an email in Dynamics 365, by default the email will be set to not be followed.

image

image

image

You can click on View Preferences to see which recipients on the email have their setting set to Do Not Allow, and you can also attempt to retry following the email should the recipients’ preferences be updated.

Note:  That there seems to be a bug with this functionality currently at the time of this blog post.  When the email is initially created, it still shows that the “Recipient Activity will be followed” when the email form opens, regardless of the “Follow Email” preference on the contact record.  If you click on DON’T FOLLOW and then click on FOLLOW, that’s when you’ll see the indication above that one or more of the recipients prefer to not have their email activity followed.  A Microsoft Connect feedback item has been logged here.

From this area, you can also specify a time to actually send the email if you don’t want it to be sent immediately (based on research that you may have done that indicates best time to send specific communication).  Clicking the SEND LATER button will pop up a dialog that will allow you to pick a date and time for the email to be sent.

image

If you click on SET REMINDER you’re able to set one of the following reminders:

  • If a reply isn’t sent
  • If the email isn’t opened
  • Remind you regardless of lack of recipient activity

image

Both reminders and email scheduling must be done in the future, and the system will prevent you from setting them up for the past.  Once they’re setup, you’ll see the Email Engagement section change slightly which will allow you to modify the settings you setup, as well as remove them should you desire.

image

When you’re in CRM and looking at the relationship assistant, you’ll see a card for the reminders you setup that executed.  In this example, since the email wasn’t opened by the date specified, a card shows up for me indicating as such.  I can open the recipient, open the email, snooze the reminder card for 12 hours, or dismiss the reminder card.   Out of the box, these appear to only display on the Dashboards, and not on the actual Contact record.

image

 

Attachments

You have the ability to not only follow activity on a particular email (opens, clicks, replies), but you can also follow activity on attachment views.  Each time an attachment is opened is counted as an attachment view.

In order to follow attachment activity, you must first save your email (don’t send it).  Then click on the + sign in the Attachments sub grid.

Once you Browse to the file and click on Attach, you’ll see a new Follow button.  After you click on the Follow button (which will upload the attachment to OneDrive for Business which you configured earlier), you’ll have the option to stop following, or simply close out of the attachments dialog.  You can always get back to the dialog to follow, stop following, and remove the attachment by clicking the attachment hyperlink in the attachment sub grid on the email form should you decide to do so later.

image

image

image

 

Recipient Activity

When you’re on an email that’s being followed, you’ll notice a new area Recipient Activity that shows a summary view of the number of opens, attachment views, link clicks, and replies.  Directly below the summary you can see each individual detailed activity which is rolling up to that summary.  Note:  I had to track the reply from the recipient for it to be counted as a reply (Dynamics didn’t automatically notice that there was a reply in Exchange and instead needed the reply in Dynamics to count).

image

You’ll notice that the location of where the email was opened is also tracked.  In this case I just opened it from my laptop, but it would also show if I opened it from my phone as well.

Recipient activity is also visible on dashboards in the new Relationship Assistant area as a separate card.  This is also displayed on the new Dynamics 365 tablet and phone apps, you can see the same card displayed in the new Landing Page

image

image image

The Email Engagement functionality extends a little bit beyond the actual email that was sent.  If you used an Email Template, Dynamics 365 will track the opens and replies that were made to emails that used that template.  Dynamics 365 will also let you know if a particular template is recommended due to past performance.  Below you can see that Dynamics 365 is recommending the Contact Reconnect email template due to past recipient activity. 

image

When a user goes to create a new email in the future, the recommended templates will be easily visible to select from via the green star indicator.

image

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Enabling Configurable Plugin Trace Levels

As we mentioned last spring, Dynamics 365 now supports tracing messages from plugins without requiring an error to be thrown.  However as plugins become more complex, we often find ourselves wishing for more granular control over the level of detail traced without requiring code recompilation.  With these requirements in mind, we will build an elegant solution that has minimal impact on performance.

First, we'll define an enum that introduces the different levels of tracing we want to support.

This should start to look familiar if you use log4net or similar logging frameworks.  The different levels (Debug, Info, Warn, Error, and Fatal) provide the granularity we are looking for when configuring how much detail we want in our Plugin Trace Logs.  The other two values (All and Off) provide a more explicit way of completely enabling or disabling tracing.

Next we’ll add an internal class to our plugin assembly to wrap all of our trace calls.

The main constructor starts by getting the ITracingService from the passed in IServiceProvider and storing it in a field for later use.  It then goes on to look for a shared variable on the IPluginExecutionContext which will define the minimum tracing level to trace.  If that shared variable doesn’t exist, it defaults to the minimum level passed in to the constructor.

Now we’ll add a method that will actually perform the tracing.

The Trace method takes a level, a format, and an array of arguments.  If the level is at or above the minimum, the format and arguments are combined and then passed to the previously saved _tracingService.  We prefix the message with the trace level, to provide extra detail.  This could be further enhanced to provide timestamps if you are investigating performance concerns.

Finally, we’ll add a few convenience properties and methods to our Tracer class just to make it easier to use.

The properties provide a quick way to check and see which trace levels are enabled.  For simple messages there isn’t a need to check these properties, but some more detailed traces have to build up a complex messages.  In these cases, it is worth it to check and see if the targeted level is enabled before building the message.  The methods here are simple shortcuts for Trace with the level specified as the method name.

Now we’re ready to write a plugin that takes advantage of our new class.

While this plugin’s logic is very contrived, it demonstrates how to use the Tracer class.  There are examples of tracing at different levels and checking which levels are enabled before composing a more complex message. 

We can register this plugin to run during the Create of a contact using the following configuration:

BusinessLogicPluginStep

If the plugin is left registered by itself, it will always be configured to run at the “Info” trace level (The simpler Tracer constructor it uses defaults to TraceLevel.Info for the defaultMinimumLevel).  If we want to change the level without making code changes, we’ll need to introduce another plugin.

The TraceConfigurationPlugin uses the Unsecure Configuration value to set the TracingLevel shared variable on the execution context.  As long as we register this plugin to run before any of our other plugins, it can specify the level the plugins following it should use.  We could even register multiple steps for the same message with different Execution Order values if we wanted to have different trace levels for different plugins.

Here is an example of how we could register this plugin to run before the BusinessLogicPlugin and set the trace level to “Debug”:

TraceConfigurerPluginStep

Now we can use the Tracer in all of our plugins and feel comfortable adjusting the trace level as more details are needed during troubleshooting.  No additional API calls are made to read the tracing configuration values, so this will have a minimal impact on performance.

To see how to enable tracing and where to read the logs, please reference our earlier blog post.

Topics: CRM Best Practices Microsoft Dynamics CRM Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online