Mobile Options for Dynamics 365/CRM

Often in CRM implementation project, there is a need to have CRM data available on mobile devices. When using the Microsoft Dynamics 365 platform, there are a few options available and it is sometimes unclear how to decide which is the best fit for an organization. In this article, I start by giving common scenarios in which mobile access is required before describing some of the available solutions and corresponding use case.

Common Requirements for CRM Mobile Access

Sales people are often on the road, meeting with customers and prospects, attending conferences or trade shows. When they use a platform like Dynamics 365/CRM to support their activities, having access to their sales tools can be extremely beneficial: they can check out customers history on the spot prior to meetings, add notes after a visit. They can also lookup, create or update CRM contact information while away from the office and computers.

For Field Service professionals (e.g. internet cable installation agents), they need to have plenty of information to work efficiently: where to go, what to do when they get there, who they are supposed to meet, where they are supposed to go next based on their current location etc. For these types of uses, the level of interaction with the CRM data is higher than for typical sales individual, and it is more critical to their work (i.e. they could hardly do their job without it).

Another use case that I have often seen is the timekeeping requirement. We see this regularly in various Professional Services scenarios (consulting, legal, contracting etc.). Professional Services’ firm employees that are often moving from one task to another, one meeting to another, one client site to another, having the ability to enter the time spent on various tasks could add great added value.

While there are plenty of other mobile CRM requirement scenarios, I think these three are a good fit to illustrate several types of usage and need for people on the move. Now Let’s see what our options are and tag them to the scenarios they apply to.

Dynamics 365 for Phones and Tablets

Commonly referred to as MoCA for Mobile Client Application, this is the application provided at no additional cost by Microsoft as part of the Dynamics 365 offering.

  • Supported CRM Source
    • D365/CRM Online
    • D365/CRM On Premises with Claim-based + IFD
  • Installation Process
    • Download the platform application store on Windows, Android and Apple devices (tablets and phones, compatibility varies based on your Dyn 365 version – more details here)
    • Once the application is downloaded, connect to one CRM Organization using its access URL and your credentials
  • Configuration & Extensibility
    • Uses the out of the box CRM web configuration (as long as the components are enabled for mobile, example for Dashboards here)
    • The application can be extended the same way as the web forms. Most JavaScript API will work but not all – see details. You can write or skip some JavaScript code execution based on the current experience.
    • You can view your web custom resources on mobile (this of course has design / build implication to make sure the content renders nicely on mobile)
    • The application can function in Offline mode.
  • Access to Phone
    • When connected to Dyn365 Online Organization – access to GPS and Camera
  • Cost
    • No additional cost. It is included with your Microsoft Dynamics 365 licences

The OOB mobile application works nicely, providing us with facing visuals such as dashboards and tiles to access various areas. It does lack the look and feel of a native phone application in my opinion, and feels very much like a fancy/very well-built web page displayed through a mobile app. It is a major area of investment for Microsoft so expect it to get better over time.

I usually recommended using it in low application usage type scenarios that includes data consultations, charts visualization and quick updates (add, update contacts, accounts, notes etc.). This fits the Sales People scenario above nicely. It is free of charge which is a big plus when mobile access is not considered critical but a nice to have for your organization.

Power Apps

PowerApps is Microsoft’s new platform to rapidly build custom business applications for Mobile devices. Because it is part of the Office 365 suite, it can connect to most of the services and applications available in the Microsoft Cloud, including Dynamics 365/CRM.

  • Supported CRM Source
    • D365/CRM Online
  • Installation Process
    • Download the PowerApps application from the store on Windows, Android and Apple devices, connect to your Office 365 account and you will see the list of all Apps deployed within your organization and made available to you
    • There is no need to add additional credentials to connect to CRM (unless specified by the App Builder)
  • Configuration & Extensibility
    • PowerApps are build by a Power user or an expert, typically using the PowerApps Studio application, or using the app configuration tool on the web.
    • The configurators will let you start from a template or start from scratch, and connect to existing cloud services such as Dynamics 365 and other Microsoft and non-Microsoft sources. The documentation to get started is great.
    • There is a large set of configuration options (types of controls available, business rules formulas).
  • Access to Phone
    • PowerApps has commands to use the phone’s GPS and Camera. However, the interaction between the GPS and Camera and Dynamics 365 have to be customized (i.e. when the position is taken, you have to configure your app to consume and perhaps save the information in a Dynamics 365 record)
  • Cost
    • It is included in select Dynamics 365 and Office 365 plans. It is usually the best way to get it as you will connect to applications related to these services. The regular price is $7 USD per user per month, and $40 USD for app makers.

Aside from the application installation and access model that is uncommon (starting PowerApps which will display your list of available apps in your org), the app themselves look and feel much like native phone applications.

It takes more effort to get a PowerApps based-application to provide fancy graphics such as charts or customer web pages but it usually meets requirements for simple, targeted functions on-the-go, such as doing time entry. We give the user a few lists (their projects, the time entries etc.), we give them a screen to view project summary, a page to create, update time entries and link them to a project, and we are done. Again, simple, targeted function, which matches the Professional Services scenario described above.

In you are using Dynamics 365 and have Plan 1 licenses, then there is no additional cost. The effort to build PowerApps can be very low depending on the complexity of your business needs. This has potential to provide enormous value at a very reasonable cost.

Resco Mobile CRM

This is, by far, the Cadillac of mobile applications for Dynamics 365. Resco Mobile CRM is a completely configurable mobile application that can connect to Dynamics 365 and competitor Salesforce. It allows for simple configuration such as Mobile forms, views, as well as more complex business rules and custom behaviors.

  • Supported CRM Source
    • D365/CRM Online
    • D365/CRM On Premises with Claim-based + IFD
  • Installation Process
    • Download the platform application store on Windows, Android and Apple devices
    • Once the application is downloaded, connect to one CRM Organization using its access URL and your credentials
  • Configuration & Extensibility
    • Configure home screens, forms, views and additional custom behaviors through the Woodford configurator. It is a Silverlight-based application that connects to your CRM and allows you to configure the Mobile application to meet your need (don’t panic, they are rolling out an HTML5 based app to replace the Silverlight configurator).
    • All the client side configuration (forms, views, form scripts, client side business rules) are not available. New views, forms and business rules must be recreated in Woodford
    • There are a lot of advanced features such as Map or Calendar View of selected record types, Dashboards Routing and Route optimization ($)
    • There is also the possibility of extending the Mobile application using JavaScript-like code to perform all sorts of operations (hiding, showing fields, custom web pages etc.).
    • The application can function in online or offline mode.
  • Access to Phone
    • Access to GPS, Camera, phone storage to upload pictures of other types of files
  • Cost
    • Licenses are per user per month, the Professional License cost US$25 while the Enterprise License is US$40.

The thing that I really liked when we started to use Resco Mobile was that it just felt like a native phone application. The controls are the same as what you are used to in other apps, it is very responsive and just does not feel like a web page made available through a Mobile App. For use cases where users must use their phone as a main part of their job, such as a Field Service professional, who goes from one place to another, checks cases and customer information, takes pictures, gets customer signatures etc., using Resco to interact with Dynamics 365/CRM seems like a no-brainer. This is in part justified by the fact that Microsoft uses Resco Mobile as its mobile application for the Dynamics 365 for Field Services application.

Keep in mind that outside of the licenses, there is a large configuration effort that has to go into configuring and sometimes customizing the mobile experience which can take time and cost money.

If you have a large user base, you have to factor in the license price per user / month over time and see if this still makes sense for your scenario.


Advertisements

Products and Prices synchronization between Dynamics CRM/365 and ERP

When Dynamics 365 is used as a Sales force platform, there is often a need to identify the products that customers are buying in order to determine information such as sales price, support eligibility or other more business and industry specific information. Dynamics 365/CRM offers a set of entities and processes to manage the sales cycles. However, in most cases, the sales have to be recorded in a Finance system, often referred to as ERP (Enterprise Resource Planning) software. This article talks about what Dynamics 365/CRM has to offer on the sales process, product and price management side, what the limitations are then it comes to integrating with an an ERP and discusses some possible solutions.

Managing Sales Process and Pricing in Dynamics 365/CRM

Dynamics 365/CRM comes with a pre-defined sales process that can take you from a lead to a sales order and an invoice. It’s up to each organization to decide what entities they want to use in the process and configure it to meet their needs. The image below shows the sales cycles as defines by Out of the Box Dynamics 365 for Sales.


During the sales process, there is a level of interaction with products and prices at almost every step.

  • In the Opportunity, you enter the list of products and prices that your prospect is interested in.
  • In the quotes, you can copy the products selected in the related opportunity and update them, change the prices, rework the quote until it is accepted by the customer
  • The Order uses the products and prices defined in the accepted quote and the Invoice has the same information as the order

Prior to being made available for selection, the products and prices have to be defined and published in the system. The principle (at a very high level) is illustrated in the image below:



I’m purposely not going over details related to the Price List setup (e.g. volume discounts setup) or Opportunity (write-in products, percentage or amount based manual discount etc.). There is much more to it but I just want to give the big picture here. To sell products in CRM, you must have pre-defined Price List per currency. If you sell in a lot of regions, have a lot of different bundles with lots of product types and variances, then you might end up with a system that is loaded with products and price lists. There is no issue with this model as long as there is an established process to manage those products and price lists in your CRM system.

What are the challenges when ERP comes into play?

There are a few challenges that we see in the field as it relates to the process and structure above.

The out of the box sales process ends with the creation of a sales order and an invoice in Dynamics CRM/365. The reality is that a lot of businesses have these steps in an ERP or have to synchronize what CRM produces to a Finance system. This can be complex because the details about the products selected in the Quote/Order/Invoice have to have matching elements in the ERP system (usually SKU). This means that your product and pricing information has to be synchronized between your CRM and your ERP. This is often a challenge.

ERPs typically have more advanced ways to manage products and prices. They are not as rigid as the price-list based Dynamics 365/CRM structure. As an example, you can have product masters that serve as models for variants (e.g. product is a t-shirt, variants can be size, color, drawing etc.) and prices are automatically calculated based on the selected variables, the region and various other configurable parameters. These mechanisms present in ERP systems are in many cases more adopted for complex products and pricing structures because they allow for more flexibility and result with a model that is easier to maintain. The direct consequence for synchronizing product and price lists with Dynamics CRM/365 is that the data structure of the ERP either has to be converted into a price-list based model, or CRM has to be customized to match the ERP system’s product and pricing structure. Here are a few suggestions and guidelines when you are faced with this type of decision:

  1. If the ERP data model is not too far from the CRM model, you can simply make adjustments as required in CRM and synchronize the data between the 2 systems as needed.
  2. If the ERP data model is complex (e.g. uses product variants), ask yourself the following questions
    • Is it even possible to adapt the CRM data model to match the complex ERP structure?
    • What is the effort (data modeling, data transformation) to keep the CRM and ERP products and prices in sync? (Some ERP systems have ways to automatically generate a price-list based data structure for extraction)
    • Considering that the data model and sync issues are resolved, does the structure and volume of the data (number of products and price lists and data model) allow for a good user experience on the CRM sales side? (i.e. can users still easily find their products and price lists in CRM while working with opportunities or orders etc.). – you might have to create a custom user interface to provide your users with a better experience in order to drive adoption.
  3. Consider using a Configure Price Quote (CPQ) solution as an add-on to Dynamics CRM/365. Some of them are extremely well designed and provide the ability to configure complex product pricing structures while taking care of the user interface to build quotes (add products and automatically calculate prices etc.) and being integrated with Dynamics 365 for Sales/CRM and some ERP products.

A question is often asked: if ERPs are more flexible for pricing, why not have your sales people directly working in ERP? And the answer is simple for Dynamics 365. First, the cost, it is generally much cheaper to buy a Dynamics 365 for Sales app license than to buy an ERP license. Second, Dynamics 365/CRM is much more configurable to adapt to the business processes (creating fields, forms, views, relationships, integrated reports, sales suggestions etc.). I could go further but I won’t. Don’t have your sales people working out of your ERP, it’s generally a bad idea.

Conclusion

    Product management in Dynamics CRM/365 is a relatively rigid process. When you have a complex scenario where the products and pricing info comes from another system, it is important to carefully analyse the gap with the Dynamics 365 structure and to decide how you want to close that gap.

Happy CRM’ing!


Recurring Jobs Strategies for Dynamics CRM/365

With the rise of the cloud, I have seen lots of small businesses building their technology strategy with a very little amount of local infrastructure. Similarly, I also see larger enterprises migrating to the cloud and trying to remove most of their local infrastructure. In Dynamics CRM/365 implementations, we often need to run recurring jobs that executes business logic (data integration or synchronization, complex calculated field etc.). This article talks about the different places where you can have these Dynamics 365/CRM connected jobs running periodically.

Windows Executable or SSIS Packages

Windows Executable are a simple and very common approach. The principle is to write an Console Application and use CRM SDK to connect to CRM and C#/.NET and other APIs to connect to various systems as required to do all sorts of data processing. After the console app is coded and tested, it is typically deployed on a Windows Server machine as a Scheduled Task. Using a Window Services is a similar approach, the main difference is that the recurrence of the execution needs to be managed at the application level (in the Window Service code) instead of leveraging the Task Scheduler built-in feature. This strategy gives a lot of flexibility:

  • no constrains on how long the process can run for
  • you provide the hardware required to handle your activities
  • you leverage internal resources if they have .NET/C#/CRM SDK knowledge
  • no need to build a UI which saves a lot of time on the development side

If your business operates mostly in the cloud and you don’t have available servers to install and run you application(s), you can create a Virtual Machine in the cloud and deploy your executables on it (as long as your CRM/Dyn365 organizations and other integrated systems are accessible from the VM).

Using SQL Server Integration Services (SSIS) Packages is pretty much identical to the Windows Executable approach. The difference is that you use SSIS, combined with a third-party tool for your CRUD operations with CRM/Dyn365 such as KingswaySoft, to contain your business logic and manipulate your systems data. You can then schedule SQL Jobs to run SSIS packages on a recurring basis. This technique is used when there is stronger knowledge on the SQL/SSIS side within an enterprise. Again, if you do not have a local infrastructure, you will have to create a Virtual Machine in the cloud with the required SQL Server components to create SQL Jobs and execute SSIS packages.

Recurring CRM Workflow(s)

While Dynamics CRM/365 does not have true task scheduler functionality, out of the box processes (workflows) can be used to achieve similar type of functionality. This is done by using the “Process Timeout” operation within a CRM Workflow. Check this article from PowerObjects on exactly how to setup recurring workflows in CRM 2016.

In order to run custom business logic, data integration or calculation, you can create Custom Workflow Activities and call them from within the recurring workflow. The custom activity is native C#/.NET Code so you can do all sorts of operations from there. I love this approach because it allows you to keep your recurring processes mechanism inside the CRM solution. It makes the deployment lighter and simpler, you don’t have to deploy a package on a SQL Server, you don’t need to deploy an application on a server and configure it. That being said, this approach has quite a few limitations:

  1. It is not simple to reference libraries other than .NET and CRM libraries, fellow MVP Gonzalo Ruiz has a good article on how to achieve this here. If your custom business logic makes references to many external assemblies, it will be a bit more challenging to integration in a Custom Workflow activity (it’s a good idea to target web services instead).
  2. When your custom workflow activity as running is isolation mode or Sandboxed (this is always the case in cloud-base Dynamics CRM/365 Online tenants), there are limitations on what you can in the custom workflow activity (e.g. how to call external web applications, no IO operations, cannot access registry etc.). There is also a 2-minute timeout limit for any process running in Sandbox.

If your business logic is long to execute (more than 2 minutes), this is not a viable option.

Using Microsoft Flow

Flow is relatively new to the Microsoft Cloud. It is a configurable workflow engine that allows to automated operations related to a large variety of cloud applications. The workflows have triggers that originate from cloud applications (e.g. email received from a specific sender, document created in OneDrive, or Contact created in Dynamics 365) or timer based.

Flow offers a connector to Dynamics 365 in the cloud with a few trigger operations (record created, updated, deleted) and basic actions on Dynamics 365 such as creating, retrieving, updating or deleting a record or retrieving a list of records. This is a detailed article from Wayne Walton that perfectly summarized what Flow is and how it can be used, you can read it here.

While Flows can run on a schedule (every x seconds, minutes, days, hours), there is a limit to the systems you can connect to from flow (last time I checked, there was integration built with just over 80 SaaS apps). If you want flow to execute custom business logic, you can develop and expose a Web API to the web and configure Flow to call it with contextual parameters. Custom operations can then be processed from within the Web API.

The biggest advantage of using Flow is the ease of configuration. Power users with enough knowledge of Flow and Dynamics 365 can easily configure workflows. However, depending on the complexity of the operations that need to be executed, you might find yourself limited with the basic operations available. This could force you to write a custom Web API for additional processing. Overkill if you ask me, but there are situations in which this could make sense.

Other facts to take into consideration:

  • Flow can only connect to Dynamics 365/CRM organization in the Microsoft Cloud. If you are running on-premises with IFD, it will not work.
  • The License for flow is based on a number of runs per month (4500 with Plan 1 and 15000 with Plan 2).

Azure Functions

If you are not familiar with Azure Functions, you really should do that soon: “Azure Functions is a solution for easily running small pieces of code, or “functions,” in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it” (reference here).

You can write functions in the development language of your choice (C#, F#, Node.js, PHP or Python) that connect to various external services or systems, including Dynamics 365. See this walkthrough if interested in knowing what’s involved. Azure Functions support events based on a configurable timer.

What I particularly like about Azure Functions is that it is a pure serverless architecture to run custom code. If you had a small console application deployed as a scheduled task, you can easily bring your code into Azure Functions and do the same operations.

If you are a company that does not want to deal with the overhead of having and maintaining servers internally to run your recurring processes, this is definitely the way to go. The billing calculation is complicated, but in short you only pay for the resources your code consumes when it runs. That means if you don’t run anything for a period of time, you have nothing to pay. Another positive about Azure Functions is that we can reference the CRM SDK which means should be able to connect to IFD-configured on premise installations (I haven’t tried this but I am pretty confident).

One of the downside of using Azure Functions is the development experience. While this is changing, at the beginning you could only write your code in the Azure Functions code editor which makes you lose the magic of Visual Studio.

 

Of course, these are a few existing options for recurring processes as it relates to Dynamics 365/CRM. Ultimately, the decision for each enterprise comes from its strategy, its people and its willingness to make investment.

Hope this helps !


Tips to conduct a successful upgrade from CRM On Premise to Dynamics 365 Online

This blog post is more relevant if you are looking to upgrade from CRM 2013 or 2015 on premise to Dynamics 365 Online. However, some sections are relevant for all upgrades of Dynamics CRM/365 in general.

With all the features that are added at a very rapid pace to Dynamics 365 and all the features that are exclusive to the cloud version, a lot of companies are looking to upgrade from the current on premises version of CRM to Dynamics 365 online. What are some of the key aspects to consider before and after upgrading?

Before you upgrade

It’s a good idea to look at some of the known issues with your version of Dynamics CRM. For example,

  • The growth of the Async Operation Base table that can cause performance issues (Microsoft provides a resolution here);
  • The growth of the Principal Object Access (POA) table which can also cause performance issues and is mostly due to an excessive use of the record sharing feature (read Scott Sewell’s article about the POA table here)

This is not meant to be an exhaustive list, but the idea is look at what are the known issues or gotcha’s that cause problems in your current version of CRM and fix them prior to starting your upgrade. That way, you will not be upgrading you problems.

The Upgrade Process

While we wait for Microsoft to give us great news allow to import existing Dynamics CRM/365 databases to the cloud for restore, the current migration path to Dynamics 365 in the cloud is to create a solution package that contains cloud-compatible components and import it into a Dyn365 Online organization. That operation is followed by a data migration using the tool(s) of your choice (KingswaySoft, Scribe, CRM Import Wizard, custom solution etc.) to move your data from the on premise version of CRM to the Dynamics 365 in the cloud.

If you are on CRM 2013 SP1 or above, check to Solution Import version compatibility to ensure that your Solution can import into a Dynamics 365 organization. If you are in version prior to CRM 2013, you must upgrade to CRM 2013 SP1.

Now that you know that your solution will be able to import in Dynamics 365, there are changes that need  to be made prior to the move to the cloud and after.

General Considerations

  • You must ensure there is an existing mapping for your CRM users on premise with the cloud subscription your Dyn365 will be running on. You can use Azure AD Connect to make sure you users exists in both active directory.
  • You need to ensure there is connectivity between your existing integration points and your CRM Online instance. Generally, this means that your integration points must be somehow exposed to the internet.

Before you move to Dyn365 Online

  • Download, install and run the Custom Code Validation (from CRM 2015, for 2013). This will allow you to identify the possible bad JavaScript code and update prior to the upgrade.
  • In Dynamics 365 Online, all CRM plugins and custom workflow activities are configured to run in an isolated environment often refer to as sandbox.
    • Running in sandbox means some operations are not allowed. Update your plugins and custom workflow activities following the guidelines if needed:
      • Remove any IO operations read/write disk
      • Remove any operation that access the event logs
      • Remove any operation that access the registry
      • Ensure plugins and custom activities connect to web the right way (see recommendation from Microsoft here)
      • Validate there are no lengthy processes such as asynchronous workflows and/or custom activities. Processes running in a sandbox are configured to timeout after two minutes. If you have any processes of the sort, your options are:
        • Find a way to reduce the execution time of the existing processes
        • Remove the processes from CRM and replace by new functionality
        • Move the business logic to an external process that connects to CRM and perform the business logic on a dedicated machine managed by CFIA.
    • Finally, update the plugins and custom activities to running in fully trusted environment to run in sandbox using the plugin registration tool. If this is not done, you will not be able to import your CRM Solution in Dyn365 Online.
  • In Dynamics 365 Online, access to the CRM database views is not allowed. Reports written in SQL must be replaced
    • Update SQL-based reports to use Fetch XML for querying data
    • When it is not possible to reproduce the same type of complex queries with Fetch XML, you must consider other ways to run your reports (e.g. PowerBI, manual data export to SQL Azure database…)

These steps will remove components that will prevent your solution to be uploaded for Dynamics 365 Online. Once you have gone through the list, you can export your CRM 201x solution package and import it to your Dyn365 Online Organization (import to a dev org as unmanaged).

After you have moved for Dyn365 Online

This is when the fun begins! These are some of the key steps that you have to go through after the solution from a previous version of CRM has been loaded into Dynamics 365 Online.

  • Update plugin and custom workflows libraries SDK references (remove references to SDK version 6.x, 7.x, 8.0, 8.1, and add references to assemblies to SDK version 8.2, fix errors compile errors if any is found)
  • Update client side JavaScript code with new/enhanced Xrm.Page API methods
  • Update client side JavaScript code that calls the OData REST Endpoint to call the Web API instead (use Jason Lattimer’s REST Builder for a HUGE time gain).
  • Update Business Rules to leverage enhanced features where needed (e.g. ability to clear values, default branch, client and server scope etc.)
  • Open each Process Workflow, Dialog, Action (one by one), fix errors if any and activate
  • Open each Business Process Flow (one by one), fix errors if any and activate
  • Open each CRM form from used entities, verify the look and feel, adjust as needed
  • Open each dashboard (if any), validate look and feel and adjust as needed
  • Validate Sitemap and Application ribbons
  • Update your Email Router configuration (or Migrate settings from the Email Router to Server Side Synchronization)
  • Review and update functionalities as needed (e.g. replace plugins with Synchronous workflows or Business Rules, leverage other new features where possible and required) – this is a classic one liner that can take days, weeks or months to be completed depending on how complex your system is J
  • Export the solution as managed and import in your pre-prod (or other environment based on your internal release model) for testing
  • Gear up for your data migration using the tool(s) of your choice, test it, test it, test it again, then run it J
  • Go to production J

There you have it. It is always good to have a checklist of things to look for when upgrading a Dynamics CRM to the cloud (also applicable for partner hosted scenarios).

Plugin on Retrieve and Retrieve Multiple – How bad is it?

I have managed to be in the Dynamics CRM/365 world for over 7 years without having to write a single plugin on Retrieve and Retrieve Multiple. The recommendation that I give is to stay away from those. The reason is simple, it sounds horrible from a performance standpoint, and even people from Microsoft have recommended against it in many scenarios. Faced with an issue recently where we had to really consider it, I did some research and testing to try to measure the impact of such plugins on system performance. This article provides some background as to why we recommend against these types of plugins, and it also provides some of our finding after we tested for performance.

Why are Plugins on Retrieve Multiple scary?

When looking at the event execution pipeline for Dynamics CRM/365, we need to consider that there are a lot of steps involved as part of every CRM transactions. To do anything, we need to go through the CRM web service APIs which will start the chain of events in the pipeline (pre-validate, pre-event, core action/database access and then post-event).


This means that in general, it is a good practice to build everything for optimized performance to give your user base a good experience. It’s not like having a custom database where you can create store procedures easily, add triggers and so on, taking advantage of the SQL Server features and infrastructure.

Now, back to Retrieve and Retrieve Multiple plugins.

Retrieve Multiple: Think about it this way, you retrieve a list of 200 accounts, your plugin on Retrieve Multiple fires once and gives you the list of accounts being returned to the screen with all columns being retrieved. For each of these row, you do some type of operation. It doesn’t too sound good, does it?

Retrieve: You double click on an account from a list view. As the account columns are being retrieved to display the account form on the screen, you plugin on Retrieve fires and gives you the account object. At that point you can modify the content of the columns being retured as required before they are returned to the screen for the user. This really doesn’t sound too bad.

Some Findings on the impact on Performance

To provide some context into what we were trying to do, I wrote about multi-language lookup in a previous blog post. One of the solution that we have considered for one of our client is to use a plugin on Retrieve and Retrieve Multiple in order to change the value of the lookup primary fields in order to display a value in the user’s current language. The method we used is similar to what Aileen Gusni does here and almost identical to what Scott Durow does here.

We store a Region in a custom Entity. Accounts have a lookup that indicates its region.

Scenario 1:

The Region’s Primary Field contains a concatenation of the English and French region names with a relatively safe separator (we use “|”). When you load the list view of accounts, we have a plugin on Retrieve Multiple that looks at the columns being returned. If the Region column is returned, we retrieve the user’s language, we split the name of the region with the separator (the name is available in the entity reference) and we replace its value in the target object by the region name in the user’s language. The plugin on Retrieve does the same operation on the single role being retrieved.

The average execution time for the Retrieve Multiple plugin when loading 150 rows was 15.43 milliseconds so 0.01543 seconds.
The average execution time for the Retrieve plugin to load one rows was too little for the system to return a value (we got 0 milliseconds every time).

Scenario 2:

The Region entity has English Name and French Name attributes. When you load the list view of accounts, we have a plugin on retrieve multiple that looks at the columns being returned. If the Region column is returned, we retrieve the user’s language, we then retrieve the English or French name from the Region entity and we replace its value in the target object by the region name in the user’s language. The plugin on Retrieve does the same operation on the single role being retrieved.

The average execution time for the Retrieve Multiple plugin to load 150 rows was 1003.94 milliseconds so 1.00394 seconds.
The average execution time for the Retrieve plugin to load one rows was 16.02 milliseconds so 0.01602 seconds.

What should you read into this?

While these numbers don’t look too crazy at all, especially in the first scenario, there are a lot of factors to take into consideration that are not really showing here and that will vary in almost any scenario.

  • What is the infrastructure you are running on? The faster your severs and networks, the better the performance will be.
  • What you do in these plugins matters a great deal. You should avoid or limit the number of read/writes to the database during the execution of those plugins.
  • Our tests were made with a low level of users in the system, it is critical to scale up and see what these numbers look like at peak time of your system.

With all this said, I still recommend against it. Use with a great deal of caution! If/when possible, use calculated fields instead of writing plugins on these messages. This will also keep you away from limitation such as this one.

Hope this helps!

Dealing with Multi-Language Lookups

Very often, CRM entities are used as reference data tables, for example to keep a list of countries, states or provinces or other business/industry specific data. For some businesses I have seen entities to keep a list of distributors, list of business roles, regions to only name a few. When used that way, CRM entities provide a lot of great features that cannot easily be met with option sets such as the ability to manage large reference tables, lookup search, lookup filtering, ease of adding/editing/modifying data by power users without a deployment.

One of the issues with using CRM entities for reference data is that they is no concept of multi-language lookup in the Dynamics 365 / CRM platform. Lookups will always display the value of the primary field by default. This can cause an issue in places where you must have a fully multilingual application. In this article, I provide a few possible solutions to solve this issue.

As an example, we’ll use the context of a task for which we need to track its type. The list of the available task activity types is stored as records in an entity called “Task Activity“. The Task entity has a lookup to the Task Activity entity. The information needs to be stored in English and French


1 – Task Form with Lookup to Task Activity


2 – List of Task Activities

Resolution Option 1 – Concatenate multiple languages in one field with a separator

You will be disappointed, this is not a fancy solution. In the Task Activity entity, we have one field for the name in both languages and use concatenate both field values in the primary field using a workflow or plugin.

  • Name English (Single line of text – 100)
  • Name French (Single line of text – 100)
  • Name (Single line of text – 203) – read only for users, populated with “Name English | French Name”


3 – Task Activity Form

This is the most common approach that I have seen when the number of languages is small (2 languages). This has a disadvantage of sometimes creating long name values that are not fully visible in the views and on the forms, but it’s cheap and you keep the ability to search using lookup, and display the columns in French or English the views if you need to.

Resolution Option 2 – Plugins on Retrieve & Retrieve Multiple

This solution is a little more interesting, but risky. In the Task Activity, we still have one field for the name in both languages and we still concatenate both field values in the primary field.

  • Name English (Single line of text – 100)
  • Name French (Single line of text – 100)
  • Name (Single line of text – 203) – read only for users, populated with “Name English | French Name”

The principle is to write plugins on the Retrieve and Retrieve Multiple events of the Task Activity. In both of these plugins, you need to retrieve the connected user’s language (query the user settings table), and then replace the text being returned in the Name field by the value in the user’s language. This value can be obtained by querying the task activity record and retrieving the name in French or English, or simply splitting the Name field (primary field) with the separator and return the part in the desired user’s language. One plugin will handle the lookup column in list views (Retrieve Multiple), and the other will handle the form views (Retrieve).

Generally, it is not recommended to write plugins on the Retrieve and Retrieve Multiple events for performance reason. If the operations executed in those plugins are simple and optimized, it might be a viable solution. This is a solution that can scale well if you are dealing with more than 2 languages because in all cases, users see only the value in their selected language and the multiple values are transparent to them.

Stay tuned, I have an upcoming post where I provide some metrics about the impact of a plugin on Retrieve and Retrieve Multiple on performance.

Resolution Option 3 – Automated mapping of Option Set with Reference Entity Records

This is a bit of a complex solution, by far the fanciest. The idea is to use an option set instead of a lookup to reference the task activities, but the option set values will be “controlled” with records from the Task Activity CRM entity. It goes like this:

  1. Create a global option set named Task Activity
  2. Create your Task Activity entity with a primary “Name” field. Put the name of task activities in the primary language (language of the CRM org)
  3. When a record is created in the Task Activity entity, use a plugin to create an option set value in the global option set
  4. When a record is updated in the Task Activity entity, use a plugin to update the corresponding option set value in the global option set
  5. When a Task Activity record is deleted/deactivated, use a plugin to update the corresponding global option set value by putting brackets around the name for example, and also pushing the value to the bottom of the option set list
  6. You can then get the CRM Translation file and get the Task Activities values translated as part of the global solution.


4 – Records to Option Set Value mapping

The outcome is that for entities that need to capture the task activity information, there will be an option set field as opposed to the lookup field:


5 – Task Form with Option Set

While this has low impact on performance and leverages the out of the box language-aware option sets, it requires a serious time investment to define the development framework for each entity that required this mechanism to be implemented. It also requires a translator to update the CRM translation on a regular basis (every time there is a deployment). This is a fancy solution that requires a lot of coding and maintenance. In addition to that, you lose the ability to search and filter the content easily like you would do with lookups. You should make sure yours lists are not very long if you don’t want to end up with Option Set lists that are very long which will result in poor user experience.

I have rarely seen companies making such large investments to circumvent the lack of multi-language lookup in CRM. This is usually seen when there are laws that force you to have a system running fully in multiple languages.

Resolution Option 4 – Custom Screen for Lookup views & search

This is another fancy one for which I unfortunately don’t have any screenshot. We want to leverage option sets to “overwrite” lookup values and selection process with the following steps:

  1. Create a set of standardized Web Resources for Lookup Display and lookup value selection
  2. Display the web resources on the CRM Forms and hide the lookup controls
  3. The web resources will have built-in logic to display the value in the language of the current user, as well as a mechanism to allow searches (could be auto-complete based)

Writing a standard web resource control for that purpose is relatively simple. However, you might have additional work to do if you want to take advantage of filtering based on other fields, or custom filters. Also, this solves the issue on the form in the sense that you will see the values in the right language on the form, but for list views, reports etc. the problem will still exist so you’ll need to find another solution there.

Closing Thoughts

As you can see there is no perfect solution. Each organization has to decide the level of investment and risk they want to take to make sure they have multi-language option sets. Living in Canada where we have two official languages, this is a challenge that we often see in public sector implementations because having fully bilingual system is mandated by law. There are very few countries where this is the case (which is probably why Microsoft has not made investments in this area). Most private sector companies will usually impose a primary language for the entire organization.

Hope this helps!

Microsoft Medics 365 – Session on Licensing & Upgrade

If you have questions about Dynamics 365 Licensing and Upgrade options, there is your chance to get them answered.

In the first ever edition of the Microsoft Medics 365, a panel of 6 Microsoft Business Solutions MVPs (formely known as Dynamics CRM MVPs) will discussing the new Microsoft Dynamics 365 Licensing Model as well as the Upgrade process on November 29th at 12pm ET.

Register here, we’ll be happy to share our knowledge and answer your questions!

Now that this is all over, feel free to check out the recording below. Any licensing questions, free free to ask here or on the Medics 365 Facebook page!