Sonoma Partners Microsoft CRM and Salesforce Blog

OCR in CRM

Today's blog post was written by Angel Shishkov, Principal Developer at Sonoma Partners.

OCR (or Optical Character Recognition) technology has been quietly getting better over the years, while everyone has been distracted with voice recognition (Hey Cortana! Cortana? Hey? Oh, fine, I’ll just click it). Generic solutions exist that can do character recognition and specialized solutions exist for more specific tasks, like reading receipts. CRM can also benefit from OCR, especially for getting that digitized paper data into structured CRM entities.

I will demonstrate how OCR can be used in CRM by setting up a simple integration between CRM and an OCR API.

Requirement

A theoretical customer uses paper forms to send in requisition orders for equipment. The forms are very basic and contain the equipment serial number or SKU, the amount to be requisitioned and the name of the person requesting the equipment. The equipment exists in CRM as native Products and the people exist as native Contacts. A custom entity called Requisition was created to store the SKU, Amount and Requisition By fields for each request.

The current requisition process works as follows:

  1. Requisition form is filled in and printed/scanned.
  2. Requisition form is attached to an email and sent to a CRM mailbox.
  3. A CRM user receives the email and opens the attachment.
  4. A CRM user manually creates a new Requisition record and enters the information from the attachment.

Design

We will build a custom integration with an OCR service called OCR.Space. This is a web service API, making it ideal for use from within CRM Online, and it has a free pricing tier so we can experiment with it without obligation to buy.

We will have a plugin that fires on new Emails. It will use the OCR.Space service to read the requisition form attachment and then automatically create a new Requisition record in CRM with those values.

The new requisition process will work as follows:

  1. Requisition form is filled in and printed/scanned.
  2. Requisition form is attached to an email and sent to a CRM mailbox.
  3. Email arrives into CRM and fires a custom plugin.
  4. Custom plugin reads the email attachment and sends it to the OCR service to be interpreted.
  5. Custom plugin reads the values returned from OCR and creates a new Requisition record with those values.

Everything on the CRM side will be automated, with no manual work.

Implementation

The custom plugin will fire on Email create, check if the email was a requisition, based on the address it was sent to, or the subject line, or something else, and read the attachment from the email. Attachments are retrieved from CRM as Base64 encoded strings, which is perfect for calling the OCR.Space service with.

The OCR.Space service accepts an HTTP “POST” submission with an “apikey” parameter in the header specifying the API key we are provided when we registered. The image file to read is sent through a “base64Image” parameter in the message content.

The service returns a JSON object that describes the text which was read from the image. The service documentation for the request and response parameters can be found here: https://ocr.space/ocrapi

Here is an example (oversimplified) Requisition Form that would be attached to an incoming email.

Angel 1

First, we will create some classes to hold the deserialized JSON response. They are decorated with [DataContract] and [DataMember] so we can deserialize the JSON string into them using a DataContractJsonSerializer. 

Next, we set up the base plugin that will read the email attachment. That is standard CRM work, so I will omit it here. Finally, we create a method to take the email attachment as a Base64 string, send it to OCR and create a new Requisition record from the results.

Here is what the code does:

  • Start with the URL to the OCR service and the API key. These can come from the plugin configuration or a config entity.
  • Construct the data payload for the POST request by adding the “based64Image” parameter and the “apikey” in the header.
  • Submit the request and retrieve the response from the OCR service.
  • Deserialize the response JSON string using a DataContractJsonSerializer into the classes we created earlier.
  • Read the text returned by OCR and split it up into lines. Find the lines that start with “Product”, “Amount” and “Requisition By” and parse out the values following the line labels.
  • Fill in each parsed value into the appropriate attribute on the new Requisition record.
  • Call the OrgService to create the new Requisition record.

Conclusion

Automating processes in CRM through OCR can save a lot of repetitive, manual work that is prone to data entry errors. While OCR is not perfect and will make the occasional mistake, it tends to be very good when the input image is clean, in a standard format and uses a consistent text font. If you are looking to build an OCR integration for your CRM system and need some help, give us a call. Thanks for reading!

Topics: Microsoft Dynamics 365

Dynamics 365 Demo Video: Office Groups

Today's blog post and video were created by Bryson Engelen, Sales Engineer at Sonoma Partners.

Whether you need to collaborate with colleagues who aren’t on Dynamics 365 or you need to collaborate with customers who aren’t on Office 365, the Office Groups integration in the context of Dynamics 365 makes things easy. It provides out-of-the-box integration with Office 365 Groups for agenda, conversation, OneNote, documents, and member management. While many of the feature sets of Office Groups in relation to Dynamics have been around for a while, in this release there were several powerful enhancements. First was the ability to add external members to a group who are not tied to your Office 365 instance and the ability to show their presence. There is also flexibility on associating or disassociating an existing Office 365 group with an entity record. Finally, in this release, when it comes to PSA, when you add a project team member, they are automatically added as a member of the Office 365 Group. Those are just some of the new features around the integration. To see it in action and get the perspective of both a Dynamics 365 and external group member, check out this video. 

Topics: Microsoft Dynamics 365

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

3 Dynamics 365 Demos to Make Your Life Easier

Today's videos and blog post were created by Kevin Yamashita, Sales Engineer at Sonoma Partners.

At Sonoma Partners, not only do we enable our customers to be highly successful with their CRM implementation, but we also rely on the very same tool to run our own business. While we appreciate all of the horsepower and flexibility that Microsoft Dynamics provides from the standard web client, sometimes there are use cases where this particular access point into CRM simply doesn’t fit the need. As an organization, we struggle with the same challenges that many of our customers do: timely data entry, data cleanliness, user adoption, the list goes on…

To solve some of these issues we leverage two of our specialties: UX design and custom mobile.

Today, we’d like to share three videos with you that showcase some of the custom solutions that we’ve developed to augment and improve our own internal CRM system. Recognizing that our users don’t spend every moment of their day with our CRM system open, these tools let users perform the key functions of their jobs in a place, at a time, and in a way that make the most sense for them. Because at the end of the day the success of a CRM program isn’t about technology; it’s about people and how a system can make each person’s life a little bit easier.

Project Lighthouse 

See how a custom mobile application from Sonoma Partners can make managing professional services projects easy. Whether you’re using the Project Service module in Dynamics 365 or a wholly custom setup, this streamlined UI available on the go makes interacting with CRM data a cinch.

Check Please 

This mobile application from Sonoma Partners makes it easy to log expenses in CRM while on the go. See how we improved our own internal CRM usage by making a common task simpler to perform any time and any place.

Time Buddy 

As a consulting firm, we log lots of time in our internal CRM system, but navigating to CRM to do this throughout the day was becoming cumbersome for our staff. See how we developed two new interfaces into CRM to make this constant and repetitive task easier for our entire team.

Questions? We're happy to help.

Topics: Microsoft Dynamics 365

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

Dynabacus: Now Available in AppSource

We are happy to announce that Dynabacus is now available in AppSource and on our website for on premise Dynamics CRM users! 

Dynabacus supports Dynamics CRM 2015+. As we described in a previous introductory post, Dynabacus is a record counting tool that is packaged as a Managed Solution in your CRM instance. Your team might be looking to see the impact of applying field changes, or preparing for a new integration or data migration. Or maybe you just need a record count that is more than the maximum count of 5,000 shown in grids and advanced find. Dynabacus will allow you to leverage existing views from CRM to allow you to filter and count the records you want for multiple entities or even multiple views on the same entity. Just select the entities and views and click Get Counts.

Dynabacus

We have also added the ability to export a set of counts to a csv file. This can be used to compare results before and after changes, as one example. This ability can also come in handy when running tests before making a change in production as you can import these csv files into a Dynamics instance and the set of entities and views that were used on a previous run will be populated and ready to run again.

Topics: Microsoft Dynamics 365

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

Dynamics 365 Demo Video: Relationship Assistant

Today's blog post and video were created by Bryson Engelen, Sales Engineer at Sonoma Partners.

The Relationship Assistant really makes Dynamics 365 work for you by giving you the right information at the right time.  It presents the user with the most relevant and timely information the system has to offer, like if a Lead or Opportunity is getting stale, if someone emailed about a proposal, or which of your Contacts will attend an upcoming meeting.  And what makes Relationship Assistant even more valuable is it presents information from your email inbox and calendar, like reminders about flights or a heads-up about a customer asking for a product.  Some of the things the Relationship Assistant can help you with include reminders about upcoming activities; suggestions on when to reach out to a contact that’s been inactive for a while; identifying email messages that may be waiting for a reply from you; or alerting you when an important opportunity is nearing its close date. Best of all, the Relationship Assistant can be set up against Custom Activities, so if you have important reminders that don’t fit the out-of-the-box cards, you can add some of your own.

The Relationship Assistant works constantly in the background, analyzing what’s going on for you day-to-day, and presenting you an agenda of the most important tasks, meetings, emails, accounts, opportunities, and more that deserve your attention right now. These insights are displayed as action cards that you can drill into for more information, snooze, or dismiss. The action cards are visible on the mobile app, on dashboards, and even at the top of individual records. There are many different types of cards available, which are linked to in the description of the video below. Enjoy!

Topics: Microsoft Dynamics 365

How To Make Filtering of N:N Lookups Work for You

Today's blog post was written by Rob Montague, Senior Developer at Sonoma Partners.

Sometimes you need to filter a lookup that happens to be an N:N relationship. The issue that we as developers run into is that the control.addCustomFilter JavaScript function does not support N:N relationships. In this scenario, we had Manufacturer and Product entities in a N:N relationship, and we want to prevent the user from picking the wrong product line for a manufacturer. To do this, we created 6 different views on manufacturer entity, each view representing a different product line. The below supported code is an example of how we switched views to filter the Manufacturer lookup based on which Product line is selected.

function onLoad() {

Xrm.Page.getAttribute('sonoma_productLine').addOnChange(filterManufacturer);

           }

function filterManufacturer() {

            // Lookup Filter for Manufacturer field, filter by product Line with N:N relationship

            // needed to switch default views to make this work since N:N is not supporting filters

            var productLine = Xrm.Page.getAttribute('sonoma_productLine').getValue();

            if (productLine == null || productLine.length <= 0) {

                return;

            }

var audioFilterId ='{cb607e22-5403-e711-810e-e0071b6a9211}',

       caraudioFilterId = '{cee7cc88-5403-e711-810e-e0071b6a9211}',

       computerFilterId = '{9b74e0f3-5003-e711-810e-e0071b6a9211}',

       entertainmentFilterId = '{1f5f78d3-5303-e711-810e-e0071b6a9211}',

       videoFilterId = '{5ae0cb69-5403-e711-810e-e0071b6a9211}',

       videoGamesFilterId = '{d6c351ae-5303-e711-810e-e0071b6a9211}',

       defaultFilterId = '{205AC19F-F655-4580-B894-A1D33A6FC800}',

       manufacturerControl = Xrm.Page.getControl('sonoma_manufacturer');

            switch(productLine[0].name.toLowerCase()) {

                case 'audio': //View: Active Audio Manufacturers

                    manufacturerControl.setDefaultView(audioFilterId);

                    break;

                case 'video': //View: Active Video Manufacturers

                    manufacturerControl.setDefaultView(videoFilterId);

                    break;

                case 'car audio': //View: Active Car Audio Manufacturers

                    manufacturerControl.setDefaultView(caraudioFilterId);

                    break;

                case 'computer': //View: Active Computer Manufacturers

                    manufacturerControl.setDefaultView(computerFilterId);

                    break;

                case 'video games': //View: Active Video Game Manufacturers

                    manufacturerControl.setDefaultView(videoGamesFilterId);

                    break;

                case 'entertainment': //View: Active Entertainment Manufacturers

                    manufacturerControl.setDefaultView(entertainmentFilterId);

                    break;

                default: //View: Active Manufacturers

                    manufacturerControl.setDefaultView(defaultFilterId);

         break;

            }

        }

This simple solution ended up resolving the issue we ran into and since we used all supported code, this works on mobile as well. Let us know what solutions you have come up with for this problem by commenting below!

Topics: Microsoft Dynamics 365

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: Microsoft Dynamics 365 Microsoft Dynamics CRM