Sonoma Partners Microsoft CRM and Salesforce Blog

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

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

Integrating MDR education and school data with your Salesforce.com deployment

Sonoma Partners works with multiple customers in the education industry, and they frequently ask us about integrating MDR's school data with their CRM system. If you're not familiar with MDR, they provide the most comprehensive set of data about schools and school administrators throughout the United States. Most folks consider MDR data as the "gold standard" in the education industry. If your business works with schools, that means you have a fixed universe of customers to sell to. Consequently, having clean and accurate data about schools and their contacts becomes hyper-critical!

To help make sure that our education customers have clean school data in their CRM system, Sonoma Partners developed a process to update CRM with the latest and greatest MDR education industry data on a regular basis. The MDR data updates include detailed information about both schools (accounts in CRM lingo) and administrators (contacts). Some of the data points provided by MDR include:

School / Account Sample Data Points (this is not the full list, there are over 300+ MDR account fields and 85+ contact fields)

  • MDR District Enrollment
  • MDR District Classification
  • MDR District Grade Span
  • MDR District PC Computers
  • MDR DMA Code
  • MDR School Improvement
  • MDR School Type
  • MDR Technology Sophistication Index
  • MDR Student Enrollment
  • MDR Student to Computer Ratio
  • MDR Number of Classrooms
  • MDR Number of Schools
  • MDR Open Date
  • MDR Total Budget
  • MDR Total Number of Students
  • MDR Total Software Budget
  • MDR Total Technology Budget

Administrator / Contact Sample Data Points (this is not the full list, there are ~25 MDR contact fields)

  • MDR Status
  • MDR Title
  • MDR Last Name
  • MDR First Name
  • MDR Middle
  • MDR Name
  • MDR Preferred Title
  • MDR Gender
  • MDR Last Update Date
  • MDR Job 1
  • MDR Job 2
  • MDR Computer User
  • MDR Advanced Placement
  • MDR Years at School
  • MDR Years of Teaching Experience
  • MDR Highest Degree Level
  • MDR Email Address

 After integrating the MDR data with Salesforce.com, the end users can view and access the data through the user interface and it will appear like the following:

MDR-1

MDR publishes refreshed and new data several times per year. Our integration updates all of the Account and Contact MDR data fields with each MDR refresh.  We recognized that our customers will be updating their Account and Contact data directly in Salesforce as well, and they may have more accurate information earlier than what MDR collects.  Therefore, we set up an exception process so if a user directly updated any of the MDR data fields, the integration will not update a manually modified data field with the MDR refresh for at least 6 months. Please keep in mind that we setup this exception process on a field-by-field basis.  For example, if a user updated the Phone number last month, but all of the other fields have not been updated in over 6 months, when the MDR refresh is run, all of the Account fields listed will be updated except for the Phone, which will not be overridden by the MDR integration.

We also recognized that you might NEVER want some fields overriden by the latest MDR data refresh (for example the email, Billing Address or Shipping Address).  To accommodate these scenarios we created a “Never Update from MDR” checkbox directly below each of these three data fields.  If you do not want your information overwritten, users can check this checkbox for the appropriate field.

MDR-2

MDR-3

Lastly (and maybe most importantly), MDR provides hierarchy data about how the schools rollup to districts, sub-districts, etc. This hierarchy data allows companies to perform rollup calculations of they well they perform within districts at an aggregate level. Consequently, companies could answer questions like "What's our total sales pipeline in District XYZ? How much of product X did we sell to sub-district ABC in the last 12 months?" This screenshot shows how we modeled the school hierarchy within Salesforce.com.

MDR-Rollup

The MDR data integration with CRM provides our education industry customers with several benefits, including:

  • Accurate, cleansed account and contact data
  • Access to full universe of education customers based on standardized industry database
  • A repeatable data load process
  • Reduced need for manual record maintenance
  • Better information to make informed sales and marketing decisions

And yes, if you're curious, Sonoma Partners could help Microsoft Dynamics CRM customers setup a similar integration with MDR data!

Please contact us if you're interested in learning more about our experience integrating MDR data into your CRM system.

Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM Salesforce

Dynamics 365 – Updates to Business Rules and Actions

Continuing with our posts regarding the recent release of Dynamics 365, next up are the changes Microsoft has added to Business Rules  Workflow Actions.  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. 

Business Rules

Like Business Process Flows, Business Rule were introduced in CRM 2013, and have received some updates in the Dynamics 365 release.  First and foremost is the fact that Business Rules will utilize the new Visual Process Designer that was introduced with Dynamics 365.

For each component, as you’re building out the rule and adding in additional conditions and actions, you’ll see a text definition representation of your logic.  As your Business Rule is being built out, you can see the logic grow over time.

Also added with Dynamics 365, is a new “Show Recommendation” Action.  With this action, an icon will be added next to a field that will provide some information and show a message that the user can take action upon.  During definition of the Show Recommendation action, you provide the message to display along with the action that will occur if the user clicks on “Accept” on the recommendation. 

For example, if you have an Opportunity where the customer indicated the purchase timeframe is immediate, and their budget amount is > $50,000, then you may want to recommend having the salesperson update the Rating to Hot.

See below for how the Business Rules look in the new Visual Process Designer with the Recommendation action, and the text based representation of the rules.

image_thumb41

When on an Opportunity that meets the criteria of the Business Rule conditions, the recommendation will be displayed and if the user clicks on Apply, then the Action defined in the Show Recommendation component will be executed.  In this case, we are setting Rating to Hot.

image_thumb46

Additional Actions

Microsoft also added some new out of the box Actions that can be used in Processes (Workflows, Dialogs, and Actions). 

  • Add (Case) to Queue
  • Add user to Record Team
  • Apply Routing Rule (to Case)
  • Calculate Actual Value (of Opportunity)
  • Close Opportunity
  • Get Quote Products from Opportunity
  • Get Sales Order Products from Opportunity
  • Lock Invoice Pricing
  • Lock Sales Order Pricing
  • Qualify Lead
  • Remove User from Record Team
  • Resolve Incident
  • Resolve Quote
  • Revise Quote
  • Unlock Invoice Pricing
  • Unlock Sales Order Pricing

The following two Workflow Actions were existed before the release of Dynamics 365:

  • Set Process
  • Set Word Template

image_thumb32

While Microsoft hasn’t included workflows in the new Visual Process Designer (yet), these new actions will go a long way to allowing business analysts to extend the system without code.  The stage is also set for Microsoft to extend the functionality of the Visual Process Designer in an upcoming release to include the ability to more visually create and edit workflows.

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

Dynamics 365 – Updates to Business Process Flows

Continuing with our posts regarding the recent release of Dynamics 365, next up are the changes Microsoft has added to Business Process Flows.  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. 

Business Process Flows

Business Process Flows were first introduced to Dynamics CRM back in the CRM 2013 release, and enhanced in 2015 and 2016.  Continuing the trend, there have been enhancements in the Dynamics 365 release.

Security Updates

First off, one major change is that for every Business Process flow you have, you’ll see these show up in native Security Roles in a Business Process Flow tab.  From this tab you’re able to provide Create/Read/Write/Delete/Append/Append To permissions to your BPF.    This is because going forward, every business process you create and activate becomes a table in the database just like any other entity. Every instance of that process (applied to a record) is a row in the table.

For example, you may want certain users to only see the Lead to Opportunity Sales Process, but other users you want to be able to not only see the process, but also move between stages of the process (Write permissions).  You’ll need to provide Append permissions if you want a user to be able switch processes and Append the process to the record they’re on.   The security on the BPF tab does not drive the ability to update the fields in the stage – that’s driven through normal field level security and security role permissions that have existed pre-Dynamics 365.

Note:  Your process will not show up in this tab until you Activate the process.  If you Deactivate it after updating security roles, the process will remain in the available in this tab so you will NOT need to go back and update your security roles again.  It’ll only be removed from the security role tab once you delete the process.

image_thumb3

Additional Status Reasons

Business Process Flows that are active on record can now be abandoned.  This can be done via the Process dropdown, and business processes can be queried using Advanced Find (an entity will appear for each BPF you have) with status reasons of Active, Finished, and Aborted. Users can also mark a process as Finished if it’s in the last stage of the process.  Abandoned processes change the process color to gray while Finished processes remain green.  You can reactivate Abandoned and Finished processes.

image_thumb12

image_thumb17

image_thumb18[1]

Your abandoned processes will still be viewable via the Switch Process dialog, if you click on the Archived Processes link. You can then select the abandoned/archived process to view it.

image_thumb12[1]

image_thumb13

Concurrent Processes

With Dynamics 365, you’re no longer confined to having a single Business Process flow active at a time for a record.  You can now have concurrent processes that run in parallel without conflict.  Different users or departments may be working multiple processes on the same record at the same time, and the state of the process is maintained. 

When you switch a process, you’ll be able to see what date/time each process  was started on for the record you’re on.

image_thumb3[1]

          Workflows

          Business Process flows now include additional actions that can be taken versus simply updating fields (steps) within as stage.  Stages can now execute workflows with a trigger of Stage Entry, or Stage Exit (you may want some workflows to send notifications when users enter a stage, and others to send notifications upon users existing a stage).

          Here’s a screenshot of the workflow component on the new Visual Process Designer (described in more detail here).  Note that for the workflow to show up to be selected in your Business Process, it has to be set to run On Demand, has to be the same entity as the Business Process stage, and has to be activated.

          A great use case of using workflow is to have it at the completion of a Business Process (therefore Stage Exit of the final stage), that will then use the Perform Action workflow step, to Set Process.  You can then automatically kick off the next Business Process as the current Business Process ends.  For example you can have the completion of a specific Business Process on an Opportunity kick off a workflow that creates a Case, and activates a Business Process on that newly created Case.

          image_thumb18

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

          Dynamics 365 – Visual Process Designer

          Continuing with our posts regarding the recent release of Dynamics 365, next up is discussing the new Visual Process Designer.  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. 

          Visual Process Designer

          With Dynamics 365 for Sales, a new drag and drop WYSIWYG designer has been created for creation and management of business process flows, task flows, and business rules.  When you open up the process, you’ll see a designer such as the following.  As you start adding in your stages and steps, you’ll be able to set the properties for the different pieces along the way for the component you select in the visual designer.

          image

          In the designer, there’s a toolbar at the top that gives you the ability to take the following actions:

          • Add
          • Cut
          • Copy
          • Paste
          • Delete
          • Snapshot – This will create a picture of the rule that you can send over via email for a review process
          • Connector

          In the bottom left corner you’ll see a collapsible mini map that will allow you to quickly navigate around the designer for those large business processes, task flows and business rules.

          At the top of the designer you’ll notice a Validate button.  You can click on this button to have any errors in the process flow, task flow, or business rule clearly displayed.  It’ll highlight the component and property of the component that has the error allowing you to quickly resolve any issues.  One interesting note about validation in the designer is that when you click it, it’s always on.  So if you fix the error you’ll see the error change to “Validation successful” immediately.  You can toggle validation off if you don’t want to see that message every time you add a new component.

          image

          As I was using the designer, one thing I noticed was that if I made changes in the designer, I had to get used to clicking the Apply button in the bottom right corner of each component versus clicking the Save button at the top of the process.  If you don’t click Apply first, your changes to that component will not be saved and you could get validation errors or unexpected results in your process.  Therefore my recommendation would be to get used to always clicking Apply even if you aren’t sure if you updated a component.

          Pre-Dynamics 365 processes are able to use the new designer and the new features introduced in Dynamics 365.  In other words, this functionality is backwards compatible.

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

          Microsoft Flow, PowerApps, Common Data Model, as they relate to Dynamics CRM

          Today's blog post was written by Brendan Landers, VP of Consulting at Sonoma Partners.

          Microsoft has released a number of new tools recently that are very interesting but have left a number of us asking, “What does that mean for CRM?" While I’d imagine a more official roadmap will be forthcoming, we wanted to convey our thoughts on these tools and how they may impact your CRM program or project.

          These tools are all part of the Office 365 suite and were recently made available prior to the launch of Dynamics 365.

          Landers 1

          Let’s start with Microsoft Flow. Microsoft Flow is a SaaS offering for automating workflows across applications that business users rely on. It has some similar functionality to the Dynamics CRM workflow module, but it allows you to reach across to and from other applications. So, for example, perhaps we want to create a record in a SharePoint list when a CRM record is created. In the past, that would require either a third party tool configured by a technical resource or custom development. With Flow, it’s point and click. 

          Next we will touch on Microsoft PowerApps. PowerApps is a service that allows individuals to build simple custom applications without writing code. These Apps can be published instantly and be used on the web or from a mobile device. While Dynamics CRM has a robust custom mobile solution, PowerApps can be used for use case specific apps. My colleague, Jim Steger, recently published a post on this topic which can be found here. Also, a fun side note, we use PowerApps to manage our internal blog schedule.

          Finally, let’s cover Microsoft’s Common Data Model (CDM). CDM is an Azure-based business application data model and storage mechanism available through PowerApps. CDM comes pre-provisioned with a large set of standard entities used in business applications. Users can use the standard entities but also extend the data model with custom entities, once again without writing code. The idea is allowing non-developers the ability to create a data model to support their needs. The goal of the CDM is to have a single data model that can source data from multiple systems, relate the data, and allow users to view a picture across many applications. The use cases from CRM are endless, but here are a couple examples of use cases we feel are interesting:

          • Customer X has multiple CRM systems but wants a single view of Pipeline across the organization. The customer could use Microsoft Flow to push records from all CRM systems (SFDC and Microsoft) into the CDM and leverage Power BI to report directly from the CDM.
          • Customer Y has a requirement that the Global Sales Lead receive an SMS when an opportunity is created above $1MM. To accomplish this, create a Microsoft Flow that listens to CRM opportunities and, if they meet the criteria, pushes an SMS to the Global Sales Lead via Twilio.

          All of this said, these products are all very new and therefore we’d recommend you temper your expectations accordingly. That said, the release cadence is aggressive (similar to Power BI) and as such, we think you should definitely keep your eye on these applications.

          Topics: Microsoft Dynamics CRM

          Fiddler is Your Data Migration Companion

          Today's blog post was written by Keith Mescha, Principal Architect at Sonoma Partners.

          Here at Sonoma, we are a big fan of KingswaySoft’s tools for data migration to Dynamics 365 and Salesforce. We use SQL Server Data Tools and SSIS all the time for data migrations and integrations to CRM for our clients. The tool set they provide is an add-on that allows us to quickly read and write data from the cloud. In one recent migration project, we ran into an odd issue that took a bit to figure out. Here's what happened...

          Within the KingswaySoft CRM Online adapter, there is built-in functionality to do lookups for related fields based on text provided. This will allow you to provide the text value, and it will retrieve the GUID for you to populate in the target entity. In this case we were using this functionality for loading Opportunity Products and using text lookup for the Unit of Measure attribute. This attribute is required on this entity, but we are not really using Units of Measure so we just needed to retrieve the default ‘Primary Unit’ GUID.

          Destination Editor

          So we wired this all up and started to push our data however nothing was happing. The process just appeared to hang, and we did not see any data show in CRM. No obvious errors were being returned by the KingswaySoft CRM adapter to tell us anything was wrong like we typically see. We started looking at plugins and workflows on the target org. We played around with various batch sizes, but still nothing was happening.

          After some head scratching we decided to fire up Fiddler to see what we could find in the messages being sent between our process and CRM Online. We quickly noticed that we were getting 500 errors for every call to CRM. In digging into the messages, we were getting an error that ‘UoM entity does not contain attribute with Name = ‘statecode.’ This didn’t make any sense at first, but then we remembered there is an option in the Text Lookup function to Exclude Inactive and realized very quickly this must be our issue. So we unchecked this box, and our process started working and records migrated into CRM.

          Error Code

          This seems like a defect in the product, and we will report a bug to KingswaySoft but figured if anyone else ran into similar issues this might be of some assistance.

          The key takeaway here is that for data migrations with CRM Online, Fiddler is your friend for pulling the curtain back to see what’s really going on with some of the calls that the data migration tool set might be gobbling up and not exposing. Oh and don’t check this box if using Text Lookup on the UOM entity as there is not a statuscode field on that entity in CRM apparently.

          Text Lookup Editor

          Topics: Microsoft Dynamics CRM

          Extending the Dynamics 365 Editable Grid

          Recently we blogged about the functionality of the new editable grid in the Dynamics 365 release.  One thing we pointed out in the post is that the editable grid doesn’t respect read-only fields on the form.  For example, if I have the Email field on the Contact form set to read-only and I use an editable grid for a Contact view that contains the Email field, it will allow the Email field to be editable.

          One way to make the field read-only in the editable grid as well, is to write custom JavaScript.  In order to do so, we need to utilize the OnRecordSelect event of the editable grid.  First, create a JavaScript web resource with a function called onrowselect.  For the scenario of disabling the Email field on the Contacts sub-grid, the code will look like this:

          function onrowselect(executionContext){
              var entityObject = executionContext.getFormContext().data.entity;
              entityObject.attributes.forEach(function (attribute, i) {
                  if (attribute.getName() == "emailaddress1") {
                      var emailControl = attribute.controls.get(0);
                      emailControl.setDisabled(true);
                      break;
                  }
              }); 
          }

          The code uses the execution context to get a reference to the entity and then loops through each attribute to find the email attribute and then disables the control.

          Now that we have the JavaScript web resource with the necessary function, we need to hook the function up to the editable grid.  Navigate to the form customizations where the editable grid is located.  Open the properties for the grid and there will be a new tab labeled “Events”.  Select “Events” and in the “Event” dropdown, choose “OnRecordSelect”.  Add your new JavaScript web resource and set the Function to “onrowselect” and be sure to check the option to pass in the execution context.

          image

          Click OK, save the form and publish customizations.  Now, navigate to your editable grid and when you select a row to edit it, the Email field should be disabled.

          image

          This is quick and easy to implement but the caveat here is that you need to apply this JavaScript to every editable grid for the desired entity, if it has a field that should be read-only.

          Topics: Microsoft Dynamics 365 Microsoft Dynamics CRM