Sonoma Partners Microsoft CRM and Blog

Microsoft Text Analysis and CRM–Tracking Client Sentiment

Microsoft has released a set of intelligence APIs known as Cognitive Services which cover a wide range of categories such as vision, speech, language, knowledge and search.  The APIs can analyze images, detect emotions, spell check and even translate text, recommend products and more.  In this post I will cover how the Text Analysis API can be used to determine the sentiment of your client based on the emails they send.

The idea is that any time a client (Contact in this case) sends an email that is tracked in CRM, then we will pass it to the Text Analysis API to see if the sentiment is positive or negative.  In order to do this, we will want to register a plugin on create of email.  We will make the plugin asynchronous since we’re using a third party API and do not want to slow down the performance of the email creation if the API is executing slowly.  We will also make the plugin generic and utilize the secure or unsecure configuration when registering the plugin to pass in the API Key as well as the schema name of the sentiment field that will be used.

Below is the constructor of the plugin to take in either a secure or unsecure configuration expecting the format of “<API_KEY>|<SENTIMENT_FIELD>”.

Next is the Execute method of the Plugin which will retrieve the email description from the email record and pass it to the AnalyzeText method.  The AnalyzeText method will return the sentiment value which we will then use the populate the sentiment field on the email record.

Then we have the AnalyzeText method which will pass the email body to the Text Analysis API which then returns the sentiment value.

And finally the classes used as input and output parameters for the Text Analysis API.

Now register the plugin on post-Create of Email with the Text Analysis API Key and the schema name of the sentiment field either in the secure or unsecure configuration


Now when an email is created in CRM, once the asynchronous job is complete, the email record will have a Sentiment value set from a range of 0 (negative) to 1 (positive).


The sentiment field on the email record can then be used as a calculated field on the contact to average the sentiment values of all the email records where the contact is the sender to track the sentiment of your clients based on the emails they send you.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2015 Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online

Integrating QuickBooks and Dynamics CRM

Today's post is written by Rob Jasinski, Development Principal at Sonoma Partners.

We recently needed to integrate QuickBooks Desktop with our Microsoft Dynamics CRM solution, specifically for invoices.

Since we have invoices that are generated from data that originates in CRM, our current process had us generate a report in CRM, then manually create the invoice in QuickBooks and CRM. We wanted to automate this process.

For the integration, we wanted to use Microsoft Integration Services and create an SSIS package that we can schedule to run on a nightly basis to create invoices in QuickBooks from data generated in CRM.

The first thing we needed to do was to choose a tool that would allow us to connect to, and access the data, stored in QuickBooks. We looked at many tools, but the one thing we found in common was that every tool required a proxy to be running on the QuickBooks server (if someone is aware of a way to interface with QuickBooks directly, without the use of a proxy, please feel to leave a comment in the comments section below).

Then the SSIS package communicated with QuickBooks via this proxy, so it wasn’t a direct connection from SSIS to QuickBooks. So if the proxy wasn’t running, a connection to QuickBooks couldn’t be established. Finally we chose to use the QuickBooks Desktop connector from CData as it seemed to meet all of our needs.

In the following example, we’ll give a brief demo of setting up an SSIS package to create an invoice in QuickBooks.

The first thing was to create a connection to the QuickBooks server (don’t forget the proxy application must be running on the QuickBooks server). The only required fields are the URL (of the QuickBooks server), user name, and password.


Then I setup a simple data flow task that queries invoice data from our CRM system and passes it to the CData QuickBooks destination component, which then will create the Invoice and Invoice detail records in QuickBooks.


When creating an invoice in QuickBooks there are a couple of things to note. First, there are some required fields that need to be passed in, and the invoice must have at least one detail record. At first this posed a problem for me, in that I was hoping to first create the invoice then add detail lines later. Then I discovered there is a field on invoice called ItemAggregate, which allows you to pass in one or more invoice detail records in an XML format, essentially creating the invoice and all detail records in one call. Below is an example of ItemAggregate data:

<Row><ItemName>Professional Fees - Consultant</ItemName><ItemDescription>Consultant</ItemDescription><ItemQuantity>210.7500</ItemQuantity><ItemRate>10.00</ItemRate><ItemAmount>2100.75</ItemAmount></Row>
<Row><ItemName>Professional Fees - Sr. Consultant</ItemName><ItemDescription>Sr. Consultant</ItemDescription><ItemQuantity>84.0000</ItemQuantity><ItemRate>15.00</ItemRate><ItemAmount>1230.00</ItemAmount></Row>

Once all the detail records and all required fields were passed in, the invoice was successfully created in QuickBooks. Please note that during the last step, I was logging all errors returned by QuickBooks into an error log table. This allowed me to do some trial and error runs of creating invoices that helped me determine which fields were required as those were returned as errors.

I hope this small introduction to integrating Dynamics CRM with QuickBooks can help kick start any similar projects you’ve been thinking about. Have a question about integrating QuickBooks with Microsoft Dynamics CRM? We're here to help.

Topics: Microsoft Dynamics CRM

Inside Edition: How Sonoma Partners Uses CRM to Track Time

Today's post is written by Matt Weiler, a Principal Architect at Sonoma Partners.

As a consulting company, tracking time spent on projects is critical to billing our customers correctly, making sure people are busy, and making sure we're estimating accurately. In Grapevine (our internal name for CRM), Time has relationships to:

  • Projects (which is the level the time is billed at)
  • Items (which is the unit of development or customization work that has to be done)
  • Project Task (which bundles related time together so we can see how much time was spent developing vs. testing vs. designing, etc.)
  • Cases, in addition to the actual amount of time and assorted other fields.

We've covered Time entry on our blog in the past where you can see some screenshots of how this process worked in our CRM 4.0 environment.

As you can see, for something that is a relatively simple idea (what did I do during these 15 minutes?), becomes a much more complicated process because of the way we want to use the data.

One of our first cracks at making this process easier was adding time-related fields to the Item entity. Most Time records are related to an Item in some way  (development, testing, defects, design, etc.), so this was a way to easily enter the amount of time and the Task being performed, and a plugin behind the scenes would fill in fields like the Item and Project. While this worked well for some scenarios, others still required entering in the full Time form. This includes any time not related to an item (internal meetings, time spent writing specifications, etc.). In addition, at the time, most of us kept track of our time either on Excel spreadsheets or (GASP!) on pen and paper. It was kind of a laborious task to enter in time every week, especially if you waited till the beginning of the next week when time must be entered and finalized.

So, as an intern project, our developer Mike Dearing created what is now known as Time Buddy. Time Buddy was designed to make the process of tracking, entering, and reviewing time much easier and faster. Here's a quick look:


It's a Windows desktop app, so it only works on Windows PCs, and it has be installed everywhere, so there's a bit of a maintenance downside over a centralized web site. However, it has built-in timers, connects directly to Grapevine to pull back active Projects, Items, and Project Tasks, has a bunch of great time savers like the ability to split or join multiple records, and the ability to import your weekly calendar from Outlook, thus saving the entry time for non-item based Time entries. And it caches data offline, so as long as you connect occasionally, you can track time while not connected to the Internet.

As Sonoma Partners continued to grow, we had more and more non-.NET developers using Macintosh instead of Windows PCs, so our next step was to add an editable grid inside CRM. This not only gave our non-Windows users a quick entry ability, but also we incorporated the grid into a larger CRM dashboard that broke down time entries by day and by project, making it easier to review the entered time and validate simple mistakes haven't been made before submitting the time for final approval.


Our latest updates have been in response to a more diverse set of users utilizing Time Buddy. As we’ve added an iOS practice and graphic and UX designers, those people are utilizing Macs day to day, and have had to log time the old fashioned way. When we thought about how to give them an easier way to enter time, we took a step back and thought it also might be cool if we had an iOS app to allow time entry as well. So, we created a set of web services to abstract the time entry process from CRM and utilized those services to build our new clients. We’ll also be looking to update the Windows version of Time Buddy to utilize the same services. Thus we're shielded a little bit from CRM upgrades and we can more aggressively use new features or APIs in CRM without having to update a bunch of apps, and the external time entry is all routed through the same place.

The history of Time entry at Sonoma is, I think, a classic example of the crawl, walk, run CRM strategy that makes sense:

  1. Identify the data you'd like to start tracking
  2. Build out a basic implementation of a way to track and report on that data
  3. Identify inefficiencies through talking to employees or looking at the data you've already collected
  4. Develop targeted apps and websites to make the process easier, more efficient, and increase data reliability
  5. Repeat steps 3 & 4 as your business, process, and/or people change
Topics: Microsoft Dynamics CRM

Building CRM Web Resources with React

Web Resource Development

Microsoft Dynamics CRM has allowed us to develop and host custom user interfaces as Web Resources since CRM 2011.  Since then, the web has exploded with JavaScript frameworks.  In addition, browsers have started to converge on standards both in JavaScript object support and CSS.  In short, its a great time to be building custom user interfaces on top of Microsoft Dynamics CRM.

Today we’ll be working with React, an emerging favorite in the JavaScript world.  React’s key benefits are its fast rendering time and its support of JSX.  React is able to render changes to the HTML DOM quickly, because all rendering is first done to JavaScript objects, which are then compared to the previously generated HTML DOM for changes.  Then, only those changes are applied to the DOM.  While this may sound like a lot of extra work, typically changes to the DOM are the most costly when it comes to performance.  JSX is a syntax that combines JavaScript and an XML-like language and allows you to develop complex user interfaces succinctly.  JSX is not required to use React, but most people typically use it when building React applications.

The Sample Application

To demonstrate these benefits, we’ll build a simple dashboard component that displays a list of the top 10 most recently created cases.  We’ll have the web resource querying for new cases every 10 seconds and immediately updating the UI when one is found.


The files that I will be creating, will have the following structure locally:

├── index.html 
├── styles.css 
├── app.jsx 
└── components/ 
    ├── CaseSummary.jsx     
    ├── CaseList.jsx 
    └── Case.jsx

However, when we publish them as web resources in CRM, they will be simplified to the following:

└── CaseSummary/ 
    ├── index.html 
    ├── styles.css 
    └── app.js

Other than including the publisher prefix folder, the main change is that all of the JSX files have been combined into a single JavaScript file.  We’ll step through how to do this using some command line tools.  There are a few good reasons to “compile” our JSX prior to pushing to CRM:

  1. Performance – We can minify the JavaScript and bundle several frameworks together, making it more efficient for the browser to load the page.
  2. More Performance – JSX is not a concept that browsers understand by default.  By converting it to plain JavaScript at compile time, we can avoid paying the cost of conversion every time the page is loaded.
  3. Browse Compatibility – We can write our code using all of the features available in the latest version of JavaScript and use the compiler to fill in the gaps for any older browsers that might not support these language features yet.
  4. Maintainability – Separating our app into smaller components makes the code easier to manager.  As you build more advanced custom UI, the component list will grow past what I am showing here.  By merging multiple files together, no matter how many JSX files we add to the project we just need to push the single app.js file to the CRM server when we are ready.
  5. Module Support – Many JavaScript components and libraries are distributed today as modules.  By compiling ahead of time we can reference modules by name and still just deploy them via our single app.js file.

Exploring the Source Code

The full source code for the example can be found at, but we will explore the key files here to add some context.


This file is fairly simple.  It includes a reference to CRM’s ClientGlobalContext, the compiled app.js and our style sheet.  The body consists solely of a div to contain the generated UI.


Now things start to get more interesting.  We start by importing a few modules.  babel-polyfill will fill in some browser gaps.  In our case it defines the Promise object for browsers that don’t have a native version (Internet Explorer).  The last three imports will add React and our top level CaseSummary component.  Finally we register an onload event handler to render our UI into the container div.


CaseSummary is our top level component and is also taking care of our call to the CRM Web API.  This is also our first look at creating a component in React, so let’s take a look at each function.  React.createClass will take the object passed in and wrap it in a class definition.  Of the five functions shown here, four of them are predefined by React as component lifecycle methods: getInitialState, componentDidMount, componentWillUnmount and rendergetInitialState is called when an instance of the component is created and should return an object representing the starting point of this.state for the component.  componentDidMount and componentWillUnmount are called when the instance is bound to and unbound from the DOM elements respectively.  We use the mounting methods to set and clear a timer, which calls the loadCases helper method.  Finally, render is called each time the state changes and a potential DOM change is needed.  We also have an additional method, loadCases where we use the fetch API to make a REST call.  The call to this.setState will trigger a render whenever cases are loaded.  We definitely could have made this component smarter by only pulling case changes, but this version demonstrates the power of React by having almost no impact on performance even though it loads the 10 most recent cases every 10 seconds.


By comparison CaseList.jsx is pretty straight forward.  There are two interesting parts worth pointing out.  The use of this.props.cases is possible because CaseSummary.jsx set a property on the CaseList like this: <CaseList cases={this.state.cases} />.  Also, it is important to notice the use of the key attribute on each Case.  Whenever you generate a collection of child elements, each one should get a value for the key attribute that can be used when React is comparing the Virtual DOM to the actual DOM.


The simplest of the components, Case.jsx outputs some properties of the case with some simple HTML structure.

Compiling the Code

We’re going to start with using NodeJS to install both development tools and runtime components that we need.  It is important to note that we’re using NodeJS as a development tool, but it isn’t being used after the code is deployed to CRM.  We’ll start by creating a package.json file in the same folder that holds our index.html file.


After installing NodeJS, you can open a command prompt and run “npm install” from the folder with package.json in it.  This will download the packages specified in package.json to a local node_modules folder.  At a high level, here are what the various packages do:

  • webpack, babel-*, imports-loader, and exports-loader: our “compiler” that will process the various project files and produce the app.js file.
  • webpack-merge and webpack-validator: used to help manipulate and validate the webpack.config.js (we will discuss this file next).
  • webpack-dev-server: a lightweight HTTP server that can detect changes to the source files and compile on the fly.  Very useful during development.
  • react and react-dom: The packages for React.
  • babel-polyfill and whatwg-fetch: They are bringing older browsers up to speed.  In our case we are using them for the Fetch API (no relation to Fetch XML) and the Promise object.

The scripts defined in the package.json are runnable by typing npm run build or npm run start from the command prompt.  The prior will run and produce our app.js file and the latter will start up the previously mentioned webpack-dev-server.  Prior to running either of them though, we need to finish configuring webpack. This requires one last config file to be placed in the same folder as package.json. It is named webpack.config.js


As the file name implies, webpack.config.js is the configuration file for webpack.  Ultimately it should export a configuration object which can define multiple entries.  In our case we have a single entry that monitors app.jsx (and its dependent files) and outputs app.js.  We use the webpack.ProvidePlugin plugin to inject whatwg-fetch for browsers that lack their own fetch implementation.  We also define that webpack should use the babel-loader for any .jsx or .js files it encounters and needs to load.  The webpack-merge module allows us to conditionally modify the configuration.  In our case we are setting the NODE_ENV environment variable to “production” for a full build and turning on JavaScript minification.  Finally we use the webpack-validator to make sure that the resulting configuration is a valid.

Deploying and Continuing Development

At this point all of the files should be set up.  To deploy the code, you would run npm run build and then deploy index.html, app.js, and styles.css as web resources to CRM. 

If it becomes tedious to keep deploying app.js to CRM as you make small changes, you can set up an AutoResponder rule in Fiddler to point at the webpack-dev-server.  Once this rule is in place, when the browser requests files like index.html and app.js from the right subfolder of the CRM server, Fiddler will intercept the request and provide the response from wepack-dev-server instead.  This way you can just save your local JSX files and hit refresh in the browser as you are developing.  Of course you need to be sure that you have started wepack-dev-server by running npm run start from the command line.  I have included an example for the rule I set up for this demo below:


With that you should be set to start building your own CRM Web Resources using React!

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2011 Microsoft Dynamics CRM 2013 Microsoft Dynamics CRM 2015 Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online

Analyzing Audit Logs using KingswaySoft

If you have ever looked into analyzing audit log records in Dynamics CRM, you know how hard it can be.  Using the API there isn’t a good way to retrieve all the audit log records for a specific entity.  You can only either retrieve all the changes for a certain attribute or retrieve all the changes for a specific record.  If you’re on-premise and have access to the database, you can get to the audit detail records but you will find that the data is very hard to parse through.

Thanks to the wonderful folks at KingswaySoft, with version 7.0, this is no longer the case.  With KingswaySoft v7.0, audit details can easily be retrieved for a specific entity and then can be dumped into a file or a database for further reporting or analysis.

In order to accomplish this, first you will need to make sure you have the SSIS Toolkit installed and then download KingswaySoft v7.0 here.  Then open up Visual Studio and create a new Integration Services project.


Next add a Data Flow Task and drill into it.


Then we will set up a Dynamics CRM Connection using the Connection Manager.  In the Connection Manager view, right-click and select “New Connection”.


Now select the DynamicsCRM connection and click Add


This will pop open the Dynamics CRM Connection Manager which will allow you to connect to your Dynamics CRM organization.


Now use the SSIS Toolbox view to drag the Dynamics CRM Source component onto the canvas.


Double-click the Dynamics CRM Source component to pop open the editor.  Select the Connection Manager that you created earlier and set AuditLogs as the Source Type.  In the FetchXML text editor, write a fetch xml query to pull back the records of an entity where you want to retrieve audit details from.  In my example I’m retrieving 25 account records with my Fetch XML query.


Select Columns on the left and pick the columns you would like to be a part of your report.  In my example I’m going to use action (Create, Update, Delete, etc), the objectid and objecttypecode (the record that was changed), and the userid and useridname (the user that triggered the change).


The Dynamics CRM Source component will have two outputs, one for the header audit record and one for the list of audit detail records.  In my example I want to join these two outputs into one dataset so I can display both sets of data in the same report.  In order to do this we will need to drag two Sort components onto the canvas and then connect each output into the separate Sort components.  The result should look something like this:


Now double-click the first Sort to open the editor.  Select the auditid as the sort attribute as it is the unique key to join the two datasets together and check the “Pass Through” box for all the other columns that you want to use in your report.


Now double-click the other Sort component and perform the same steps.


Next drag the Merge Join component onto the canvas, connect the two outputs from the two Sort components into the new Merge Join component and then double-click the Merge Join component to open the editor.  Select Inner join as the Join type and then select any columns you want in your report and map them in the bottom pane.


Now we need to drag a Derived Column component onto the canvas and connect the output from the Merge Join into the Derived Column component.  This component needs to be used as we’re going to output the data into a CSV file so the oldvalue and newvalue columns need to be converted from a DT_NTEXT to a DT_TEXT.  Open the editor for the component and set the expression to convert ‘oldvalue’ to DT_TEXT using the 1252 codepage and repeat the same for ‘newvalue’.


Lastly, use a Flat File Destination to output the audit records into a CSV file that can be opened in Excel.  The screenshot below is the columns I used for my output file. 


Now your Data Flow should look like the following:


Then you can run the SSIS package and you should get an output file that displays all the audit records for the first 25 retrieved accounts.  The output will show the name of the user that made the change, the field that was changed, the old value, the new value as well as if it was a Create or Update.


So there you have it!  Thanks to the wonderful KingswaySoft toolkit, it is now possible to extract audit logs into a readable output that can be analyzed as needed.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2015 Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online

A Step by Step Guide to Create Your First Survey with Dynamics CRM 2016 Voice of the Customer

Dynamics CRM 2016 was recently released and with it a whole slew of new features and functionality.  A bunch of features were planned for the initial 2016 release, but for one reason or another were delayed.  This website is a very simple way of understanding what’s been released for primetime, versus what’s in preview, what’s in development, and what’s been indefinitely postponed.

One such feature that wasn’t immediately available at the release of 2016 was Voice of the Customer.  This is the ability to create, send, and monitor surveys from Dynamics CRM.  This feature is currently only available for CRM Online, and below I’ll go into more detail on how to get it enabled, and how to create your first survey.

Note that this feature is delivered through an integration with Azure Web Services. This means data will be flowing and queued through Azure in order to take any workload of delivering and capturing customer survey data off of your CRM system for the best possible performance.  This also means that there could be a delay between survey response from making it into CRM.

Below we’re going to go into an overview of enabling Voice of the Customer, and setting up and sending your first survey.  This post won’t go into everything that’s available with Voice of the Customer as there’s a lot to it, but will cover the basics. 


To enable Voice of the Customer, simply log into the CRM Online Administration Center, and select the org you want to install VOTC to, and click on Solutions.  Then you’ll be taken to the page with the preferred solutions that you can install, and simply click on the “Install” icon to start the installation. 



Once the installation is complete in CRM navigate to Solutions and open up the Voice of the Customer solution.  Then check off “I agree to the terms and conditions” and click on “Enable Voice of the Customer”.  You’re now set to start configuring your first survey!



Survey Creation

The Voice of the Customer functionality allows you to add theming to your surveys.  To do so you just navigate to the Images and Themes area of the VOTC module. 


And from there you can go ahead and create an Image record and upload a logo that you want to use in your survey will be accomplished in later steps.  After you upload the logo and save the record you’ll be able to see a preview of the image.


You can also go to the Themes area and create a new Theme to use for your logo.  You have the ability to change the colors of most of the survey elements such as the header, navigation bar, and progress background.  I strongly recommend you make use of a UX engineer to help you pick your colors wisely so that they don’t clash too much.  If you wanted to get more advanced, you can even upload your own CSS to apply even more custom styles to your survey.


Now that you have your image and theme setup, you’re ready to create your survey.  Navigate to Voice of the Customer –> Surveys, and click New to create your new survey.  You’ll see on the survey form that there are a lot of options to configure your survey.  We’re not going to cover them all in this post but you’ll notice that the we’re able to apply the Image and Theme we created previously.


In order to actually start building out the survey questions, you need to change from the Survey to the Designer form.  You’ll notice that here there’s also the Dashboard form where you can see statistics about survey responses.  For now we’ll click on Designer and start creating some questions.


On the Designer form, you have the ability to add or delete pages in your survey via the buttons that appear underneath the vertical page layout on the left.  You can’t delete the Welcome or Complete page – those are required for all surveys.


When in the design mode, you’ll be able to drag question types from the right over onto the main pane in the middle.  When you hover over a question on the page, you’ll be able to delete the question, make quick edits inline on the page to the question label, or click the pencil icon to take you to a more advanced editor so you can change more settings for the question other than the label.



In the text box of the question (and of any label control on the survey), you can click on the (Pipe) dropdown to insert piped data into your survey.  We’ll see how this works with workflows later when we create a workflow to automatically send out the survey upon case resolution.  In this example, we’ll insert the case number into the survey question, and we’ll use the Other1 pipe to store this data (again, that’s setup when you create the workflow and we’ll discuss that in a later step).



Here’s what our welcome page looked like with all the pipes in it.  We want to make a very personalized experience for the customer as they take the survey.  I also threw the other pipes in there so you can see how we’re able to get as much data out of CRM as possible to personalize our survey for our customer.


Something else you can do to add logic to your survey is to create Response Routings.  An example of when you’d use a response routing is if you want a customer to fill out an additional question, if they answered a certain way on a previous question.  For example, you may ask the customer how they’d rate the experience with your company, and if they provide a low rating, you may want to display an additional question to gather more information on why they felt that way.  To get to response routings, click on the related records dropdown of your survey.


When you setup your response routing rules, you need to create Conditions and Actions for each Response Routing.  See below how we’re only showing the “Can you please provide us with additional information” question if the user responded 1 to the star rating question.  Otherwise we don’t show it.


After completing the above, your survey is ready to be published.  If you toggle back to the Survey form, you can click on the Preview button to see what the survey would look like to your end users.  When you’re all set, you can click on Publish so that the survey is now accessible externally.

Survey Automation and Results

Now that you have your survey setup, you can use it along with native CRM workflow to have surveys automatically sent out to your customers based on actions to CRM data.  For example, lets create a workflow that sends our survey automatically to the customer of a Case when the case is marked Resolved, asking them how their experience working with your support team was, so you can make improvements if needed, or provide recognition where deserved.

First off, create a new Workflow and make sure to have it run on update of the Case Status field.  Check to make sure the status has been updated to Resolved, and then add in a step to create a new email.  Your workflow should look similar to that below.


Now when editing the email step of the workflow, you’ll want to copy the value in the “Email Snippet” field of the Survey, and paste this into the body of the email step in your workflow.  Your email step may look something similar to the following.



Notice in this email above that I’m making the use of the piped tokens (that I had placed in my survey earlier) with dynamic data from the Case record the workflow is running on.  It doesn’t matter what field from the record I’m on that I use within each pipe.  You’ll see that in the actual survey the user is taken to that the pipes are resolved to the actual data on the Case that was recently resolved. 

Make sure to Activate the workflow, and then you can go and test it out.  Once a Case is resolved in CRM, the email that’s send to the customer looks similar to the following.


And if the user clicks on the hyperlink to launch their survey, they’ll be taken to the actual survey.  As stated above, the pipes used in the survey are resolved to the actual data from the case.  You can also see that if I answer greater than 1 on the 5 star rating of my overall experience, that I won’t see the question asking me why I rated the overall experience a 1 based on the routing rules we setup earlier.



Also note that the survey has a responsive design so that if you’re accessing it from a mobile device such as a phone, the survey resizes to fit the screen appropriately.

image   image

Upon completion of the survey, and after the data from Azure syncs back to Dynamics CRM, you’ll be able to change to the Dashboard form on your survey record to see the results trickling back in from your survey. 


You can also navigate to Survey Responses off of the Survey to see the individual responses.  If you open up a response you’ll be able to see the individual questions and answers that were asked and part of that specific response.

Note:  The responses (including the question and answer) are stored in a first class Question Responses entity.  This means that if you wanted to take this one step further, you could create a workflow on the Question Responses entity, and if a Question Response record is created where a response is poor (e.g., where the customer rated the overall experience a 1 star), an email can be sent to the appropriate team to follow up on why that customer answered that question the way they did.





As I was working through and testing out my first survey, I ran into a few gotchas that I figured would be great to note down as I suspect others may run into these similar issues.

First off, when using Response Routings, if you want to only show a question when another question has a certain value (for example in my case where I wanted to show a text box if someone rated the service a 1), you probably don’t want the text box to appear when the customer hasn’t answered the rating question.  In other words, you don’t want the text box to appear when they initially load the page of questions.  You ONLY want it to appear when they rate your service a 1.  In order for this to happen, you have to make sure that on that specific question that you set the Visibility field to “Do not display” which is the default visibility of the question.

Next, I ran into an issue with the pipes in my survey not actually being populated with dynamic data from CRM.  It had turned out that when I was testing this out with my workflow, I had copied the Email Snippet of the survey to my workflow email body more than once.  This causes the Email Snippet and Piped data to break and after I removed the duplicate Email Snippet from my workflow email, the pipes began to work as expected.

Also note that if you want the updates you made to your survey to be live, you’ll need to publish your survey after making changes.  Simply saving it using the native CRM buttons will not publish it to Azure, but instead just save the updates in CRM.

Finally, if your survey responses aren’t being returned to CRM, navigate to the Voice of the Customer solution and make sure to click on the link to Trigger Response Processing.  Note that this could take up to 15 minutes to complete and for responses to appear in CRM.


For more information on Voice of the Customer, head over to Microsoft’s website.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online

Project Service - The more you know

Today's post is written by Jeff Meister, Principal Consultant at Sonoma Partners.

The release of Microsoft CRM Online Spring Wave brings some great news for those of us focused on delivering quality customer service to our clients. 

In addition to the integration with two recent Microsoft acquisitions, ADX Studios (customer portal) and FieldOne (field service), Microsoft is also releasing  a new Project Service solution. Project Service is a PSA (Project Service Automation) solution that provides an end to end solution for delivering professional engagements and will be ideal for service-based firms.


Today, I wanted to walk you through a high-level overview of the functionality based on what we've learned to date about the solution.

Opportunity Management

CRM has traditionally handled opportunities with product line items. Project Service updates this functionality to handle what sales of service projects would need. Some key highlights would be contracts and labor rates, collaboration, practice lines, price lists and quotes; all while following your pre-defined sales methodology and best practices.

Project Planning

This is where things start to get interesting. This aspect of the solution brings key components from MS Project, and embeds them directly into CRM. Users are able to store templated project plans which are then modified and used for estimating, definition and timeline/budget tracking throughout the project lifecycle. Having these tools accessible within CRM allows for more accurate quoting, ensuring profitability and resource estimates are aligned early in the sales process. It also provides enterprise visibility to project status.


Resource Management

The solution takes the pre-sales planning work and applies that to your staffing model for demand fulfillment. This can be done across various staffing models. Whether or not your project manager or team members access the demand pool directly, or if you have centralized resource managers, resource scheduling can be done via the new solution, taking into account availability, capacity and skill sets while maintaining competencies and proficiencies.

(On a side note, we are really excited to see where this part of the solution can go when paired with machine learning!)

Time and Expense

This one is easy…mobile and desktop support for time and expense entry, with routing and a built-in process for approval. Having these data points tied directly to the project in CRM also provides the ability for immediate impact to project financials. Plus, you can access these functions through mobile applications.


Having all the project related data (contract, time reporting, expenses, billing details) under one roof allows us to easily source our invoices directly from the solution. We don’t believe this will be a full blown replacement for an ERP backend, especially at the enterprise level. That being said, this is a great direction to see the product headed, and we expect integration with other ERP systems to be available.


The Project Service solution will have built in BI capabilities around actual records for financial events, profitability, and utilization. It is also expected to have content packs available for PowerBI, allowing for rich dashboards and ad hoc analytics. 


Sonoma Partners was fortunate enough to be an early participant with this process. The solution uses native functionality in conjunction with custom screens to deliver an intuitive and very compelling application targeted for firms that manage projects, time, and resources. The solution is easy to install and configure on your base CRM Online deployment. 

As mentioned above, Project Service is available as part of the Spring Wave for CRM Online.  And, we have our fingers crossed that we will see solution available for the on premises version at some point as well. Pricing details are yet to be published, but check back for more details as those become available.

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM Online

Lookups - Null vs Empty Array

The other day I discovered an interesting ‘gotcha’ when working with a lookup in JavaScript.  A business requirement called for some JavaScript to be registered when a lookup value changed and then execute certain logic based on if the lookup had a value or not. 

This is pretty straightforward logic and could be handled easily with the following code:

var customerValue = Xrm.Page.getAttribute('parentcustomerid').getValue();
if (!customerValue) {
   // do some logic
   // do some other logic

Come to find out, this works for the most part but there is one scenario where it falls short which is where the ‘gotcha’ comes in. 

  1. Record form loads and the lookup doesn’t have a value
  2. The lookup has a value and the user selects the lookup and hits the “Delete” key
  3. The lookup has a value and the user clicks the magnifying glass, then “Look Up More Records” and then clicks “Remove Value” on the subsequent dialog
In the first two scenarios with the above JavaScript code, the customerValue variable will be null and will work as expected.  In the third scenario, the customerValue variable will be an empty array and not work as expected as it isn’t null.

Therefore we need to update the block of code with the following:

var customerValue = Xrm.Page.getAttribute('parentcustomerid').getValue();
if (!customerValue || customerValue.length == 0) {
   // do some logic
   // do some other logic

Now the code is flexible and will handle all 3 scenarios where the lookup value doesn’t exist.

Note:  This was tested in CRM 2015 Update 1 and CRM 2016

Topics: Microsoft Dynamics CRM Microsoft Dynamics CRM 2015 Microsoft Dynamics CRM 2016 Microsoft Dynamics CRM Online

Programmatically Editing Searchability of Fields

Today's post is written by Matt Dearing, Development Principal at Sonoma Partners.

We recently had a request from a customer to flip the “searchable” function on a number of fields from on to off; preventing users from searching on these fields in advanced find.

When you only want to modify a handful of fields, the easiest way to do this is through native customizations by editing the attribute’s configuration to flip its searchable value to “No.” If there are several fields to update, a great option is using the XrmToolBox’s Attribute Bulk Updater which, as the name suggests, lets you update specific attribute metadata in bulk.

However, in this case, the customer had a list of 1000+ fields across 20+ entities they wanted to have disabled to reduce clutter in advanced find. This would have taken a significant amount of time if we used the native customization editor or even the Attribute Bulk Updater, and both methods would have been prone to error. We decided to convert their list (which was originally the field and entity Display Names) to schema names and update programmatically.

The customer gave us a CSV file with a column for entity display names and another for attribute display names. Then to retrieve the schema names we used MetaBlast to export the metadata of the customer’s org. We planned on using VLOOKUPS to match the display names to the schema names but because a number of fields repeated across entities we needed to create a unique identifier for the lookup. We added an additional column to the customer-provided CSV file and the MetaBlast file and filled it with a concatenation of the entity and attribute name. With a unique identifier in place we used the VLOOKUP function to retrieve the schema names.


 var attribute = entity.Attributes.Where(x=> x.LogicalName == csvFieldName).First()
attribute.IsValidForAdvancedFind.Value = false;
orgService.Execute(new UpdateAttributeRequest()
	Attribute = attribute,
	EntityName = key
*The above code was in a try catch to print out those csv fields that could not be found or not be updated.

Next we wrote a simple LinqPad script that would: loop through the rows of the CSV, leveraging the CsvHelper NuGet package to bring the entities and attributes into memory; query each entities metadata; match the csv row attribute to the entity attribute metadata; then set the attribute metadata’s “IsValidForAdvancedFind” property to false and update the attribute.

Finally we published all customizations and voila the fields were updated. There were a handful of fields whose “IsValidForAdvancedFind” property was not updatable, and this could have been checked for in the LinqPad script, but with this being a quick one time run we just printed those fields out to the console window and let the customer know which fields could not be updated.

In the end this saved a ton of time from updating each field manually, and reduced the number of errors that manually clicking would have introduced. The customer was excited that we were able to clean up their searchable fields. It’s always good to look for existing tools to help speed up customization work, but sometimes a quick script is the best way to go especially if updating a very large number of customizations.

Topics: Microsoft Dynamics CRM

Lost in CRM Translations

Today's post is written by Mike Dearing, Development Principal at Sonoma Partners.

Alright, so you’ve finished customizing your organization and applying your company’s color palette to every nook and cranny of the application, but one task still remains – supporting your multi-lingual user base. While it may sound overwhelming, translating literally every string in your organization, keep in mind that you’re only responsible for any of the labels you and your team have put in place – Dynamics will handle everything that is native.

Below, I’ve broken down the types of translations that should be considered for your organization into 5 general categories.  But first, a few pre-requisites:

  • Ensure that you have the CRM System Administrator security role.
  • Change your language to the organization’s base language within your user settings.

  • Install Excel or an Excel equivalent.

Native User Interface

This includes out of the box components such as native entity names, native field labels, native ribbon buttons, native sitemap tiles, etc.  Dynamics provides translations for their native UI which can be enabled through system settings.  While the base language of your organization is already enabled, if an additional language is desired it must first be provisioned for usage.  For Dynamics Online customers, this process is simplified, as all available language packs are pre-installed on your server.  For Dynamics On-Premise customers, you’ll need to download the language pack(s) that you’d like to provision from the Microsoft Download Center before completing the following steps.

  1. Navigate to Settings -> Administration -> Languages.
  2. Place a checkmark next to any additional languages to be provisioned (ex: Spanish).  Take note of the ‘Language Code’ column, as we’ll be using that throughout the other translation steps.
  3. Press ‘Apply’.

  4. Read and accept the confirmation dialog.

  5. The language will start provisioning.

  6. You may close the dialog once the provisioning has completed.  Users may now select the language from their user settings.

Custom Entities & Fields

Native entities and fields will have been translated through provisioning of the corresponding language packs.  However, custom entities, custom fields, and any relabeling done for native fields will need to have translations applied.

  1. Navigate to Settings -> Solutions.
  2. On the solutions grid, if you haven’t done so already, go ahead and create a solution containing any custom entities and native entities that you’ve customized.  This will make our translation process quicker than trying to export translations from the default solution.
  3. From the solution grid, select your solution and then press ‘Export Translations’.

  4. A dialog stating that this process may take several minutes will appear.  Press OK.
  5. A zip file called ‘CrmTranslations_<SolutionName>.zip’ will be downloaded.
  6. Extract the zip file.  You will be editing the file named CrmTranslations.xml.
  7. Open CrmTranslations.xml in Excel.  This workbook has 3 tabs: Information, Display Strings, and LocalizedLabels.  LocalizedLabels will be the tab where you’ll be doing your translations.  There will be a column per language pack provisioned.

  8. You can ignore translating rows with an EntityName of Solution or Publisher.  You should also ignore translating rows with an Entityname of RibbonCustomization, as this will not be applied properly.  To translate ribbon buttons, see the “Custom Ribbon Buttons” step later.
  9. Once completed, save the translation file.
  10. If the file was extracted from the downloaded zip file, make sure to place the updated file back into the zip.
  11. Navigate to Settings -> Solutions.
  12. On the solutions grid, select your solution and then press ‘Import Translations’.

  13. From the ‘Import Translated Text’ dialog, select the translation zip file, including your updated xml, and then press ‘Import’.

  14. Once the process is completed, you may close the dialog.
  15. Publish all customizations.

Custom Sitemap Tiles

Only custom tiles with custom titles need translations.  Note that most tiles, even ones pointing to custom entities, will automatically translate based on other translations added to the environment in a prior step (see: “Custom Entities & Fields”).

  1. Navigate to Settings -> Solutions.
  2. Create an Unmanaged Solution with ONLY the Site Map in it.
  3. You can add the site map to this solution by clicking ‘Client Extensions’ from the left navigation and select Add Existing, Site Map.

  4. Export the solution.

  5. Within the solution zip, open the Customizations XML.
  6. Note the languages node at the bottom of the file.  It should include all of the provisioned languages within your organization.

  7. For any custom title nodes, ensure there is a title node per locale id specified within the languages node.
  8. Save the XML file when finished.
  9. If the file was extracted from the downloaded zip file, make sure to place the updated file back into the zip.
  10. Navigate to Settings -> Solutions and import the solution zip back into CRM.

  11. Publish all of the customizations.

Custom Ribbon Buttons

Only custom ribbon buttons added to a ribbon need translations.  This includes the application ribbon as well, in case you’ve customized that.  Native ribbon buttons will translate through the provisioning of the associated language pack.

  1. Create an Unmanaged Solution containing all of the entities with custom ribbon buttons.  Note that if you have edited the application ribbon, you’ll want to add that by clicking ‘Client Extensions’ from the left navigation and select Add Existing, Application Ribbon.  In the example below I’ve included the native Quote entity. 
  2. Export the solution.

  3. Within the solution zip, open the Customizations XML.
  4. Search for “<LocLabels>”.
  5. Each <LocLabel> node within the XML should have a <Titles> node nested within.  Inside of each <Titles> node is a <Title> node that specifies a string, as well as a language code.  Ensure that a title node exists per provisioned language.

  6. Save the XML file when finished.
  7. If the file was extracted from the downloaded zip file, make sure to place the updated file back into the zip.
  8. Navigate to Settings -> Solutions and import the solution zip back into CRM.

  9.  Publish all customizations.

Custom Code

Custom HTML pages, javascript messages, and certain plugin messages should be translated as well.  There are various options here, but the two most common ones are:

  • Create a custom ‘Translation’ entity and add records within that entity to store a translation value, a translation key, and a locale id per language pack, per message to translate.
  • Create an xml web resource to store a translation value, a translation key, and a locale id per language pack, per message to translate.

Whichever path you choose, you can then retrieve those translations from your custom code as necessary based on the current user’s locale. Server-side, consider querying the usersettings entity for the uilanguageid and localeid. Client-side, consider leveraging the Xrm library’s Xrm.Page.context.getUserLcid().

And that’s it. While we may not excel in providing the translations themselves - though we do like to dabble in upside down question marks while buffing up on our ascii face art like so: (*¿*) - we do excel in helping you get your environment ready for them, so let us know how we can help!

Topics: Microsoft Dynamics CRM