Maximizing Your Power Platform Solution’s Reach: Essential Performance Considerations for Optimal Efficiency

Hi Folks,

This blog post is all about performance considerations for your Power Platform CE Projects and how you can plan to optimize application performance for your Power Apps. So I just want to take you through them…

Are you tired of creating solutions for longer durations and while at the end of the project or during UAT you end up facing performance issues for the solutions you have developed, one of the most important non-functional requirements for a project’s success is Performance. Satisfying performance requirements for your users can be a challenge. Poor performance may cause failures in user adoption of the system and lead to project failure, so you might need to be careful for every decision you take while you design your solutions in the below stages.

Let’s talk about them one by one..

1. Network Latency and bandwidth

A main cause of poor performance of Dynamics 365 apps is the latency of the network over which the clients connect to the organization. 

  • Bandwidth is the width or capacity of a specific communications channel.
  • Latency is the time required for a signal to travel from one point on a network to another and is a fixed cost between two points. And usually many of these “signals” travel for a single request.

Lower latencies (measured in milliseconds) generally provide better levels of performance. Even if the latency of a network connection is low, bandwidth can become a performance degradation factor if there are many resources sharing the network connection, for example, to download large files or send and receive email.

Dynamics 365 apps are designed to work best over networks that have the following elements: 

  • Bandwidth greater than 50 KBps (400 kbps)
  • Latency under 150 ms

These values are recommendations and don’t guarantee satisfactory performance. The recommended values are based on systems using out-of-the box forms that aren’t customized.

If you significantly customize the out-of-box forms, it is recommend that you test the form response to understand bandwidth needs.   

You can use the diagnostics tool to determine the latency and bandwidth:

  1. On your computer or device, start a web browser, and sign in to an organization.
  2. Enter the following URL, https://myorg.crm.dynamics.com/tools/diagnostics/diag.aspx, where crm.dynamics.com is the URL of your organization.
  3. Click Run.

Also, to mitigate higher natural latency for global rollouts, customers should leverage Dynamics 365 Apps successfully by having smart design for their applications. 

2.Smart Design for your application

Form design 

  • Keep the number of fields to a minimumThe more fields you have in a form, the more data that needs to be transferred over the internet or intranet to view each record. Think about the interaction the user will have with the form and the amount of data that must be displayed within it.
  • Avoid including unnecessary JavaScript web resource librariesThe more scripts you add to the form, the more time it will take to download them. Usually, scripts are cached in your browser after they are loaded the first time, but the performance the first time a form is viewed often creates a significant impression.
  • Avoid loading all scripts in the Onload eventIf you have code that only supports OnChange events for fields or the OnSave event, make sure to set the script library with the event handler for those events instead of the OnLoad event. This way loading those libraries can be deferred and increase performance when the form loads.
  • Use tab events to defer loading web resourcesAny code that is required to support web resources or IFRAMEs within collapsed tabs can use event handlers for the TabStateChange event and reduce code that might otherwise have to occur in the OnLoad event.
  • Set default visibility optionsAvoid using form scripts in the OnLoad event that hide form elements. Instead set the default visibility options for form elements that might be hidden to not be visible by default when the form loads. Then, use scripts in the OnLoad event to show those form elements you want to display. If the form elements are never made visible, they should be removed from the form rather than hidden.
  • Watch out for synchronous web requests as they can cause severe performance issues. Consider moving to asynchronous for some of these web requests. Also, choose WebApi over of creating Xml HTTP Requests (XHR) on your own. 
  • Avoid opening a new tab or window and do open the window in the main form dialog. 
  • For Command Bar, keep the number of controls to a minimumWithin the command bar or the ribbon for the form, evaluate what controls are necessary and hide any that you don’t need. Every control that is displayed increases resources that need to be downloaded to the browser. Use asynchronous network requests in Custom Rules When using custom rules that make network requests in Unified Interface, use asynchronous rule evaluation.

Learn more Design forms for performance in model-driven apps – Power Apps | Microsoft Learn

Latest version of SDK and APIs 

The latest version of SDK, Form API and WebAPI endpoints should be used to support latest product features, roadmap alignment and security. 

APIs calls and custom FetchXML call velocity 

Only the columns required for information or action should be included in API calls

  • Retrieving all columns (*) creates significant overhead on the database engine when distributed across significant user load. Optimization of call velocity is key to avoid “chatty” forms that unnecessarily make repeated calls for the same information in a single interaction.
  • You should avoid retrieving all columns in a query result because of the impact on a subsequent update of records. In an update, this will set all field values, even if they are unchanged, and often triggers cascaded updates to child records. Leverage the most efficient connection mechanism (WebAPI vs SDK) and reference this doc site for guidance on the appropriate approach.

Consider reviewing periodically the Best practices and guidance when coding for Microsoft Dataverse – Power Apps | Microsoft Learn and ColumnSet.AllColumns Property (Microsoft.Xrm.Sdk.Query) | Microsoft Learn.

Error handling across all code-based events 

You should continue to use the ITracingService.Trace to write to the Plug-in Trace Log table when needed. If your plug-in code uses the ILogger interface and the organization does not have Application Insights integration enabled, nothing will be written. So, it is important to continue to use the ITracingService Trace method in your plug-ins. Plug-in trace logs continue to be an important way to capture data while developing and debugging plug-ins, but they were never intended to provide telemetry data.  

For organizations using Application Insights, you should use ILogger because it will allow for telemetry about what happens within a plug-in to be integrated with the larger scope of data captured with the Application Insights integration. The Application Insights integration will tell you when a plug-in executes, how long it takes to run and whether it makes any external http requests. Learn more about tracing in plugins Logging and tracing (Microsoft Dataverse) – Power Apps | Microsoft Learn.   

Use Solution Checker to analyze solution components 

Best practice is to run Solution Checker for all application code and include it as mandatory step while you design solutions or check when you complete developing your custom logic.

Quick Find 

For an optimal search experience for your users consider the next:

  • All columns you expect to return results in a quick find search need to be included in the view or your results will not load as expected.
  • It is recommended to not use option sets in quick find columns. Try using the view filtering for these. 
  • Minimize the number of fields used and avoid using composite fields as searchable columns. E.g., use first and last name as searchable vs full name.
  • Avoid using multiple lines of text fields as search or find columns.
  • Evaluate Dataverse search vs using leading wildcard search

3. Training

This step should be done during user training or during UAT. To ensure optimal performance of Dynamics 365, ensure that users are properly leveraging browser caching. Without caching, users can experience cold loads which have lower performance than partially (or fully) warm loads.

 Make sure to train users to: 

  • Use application inline refresh over browser refresh (should not use F5)
  • Use application inline back button instead browser’s back button.
  • Avoid InPrivate/Incognito modes in browser which causes cold loads.
  • Make users aware that running applications which consumes lot of bandwidth (like video streaming) may affect performance.
  • Do not install browser extensions unless they are necessary (this might be also blocked via policy)
  • Do use ‘Record Set’ to navigate records quickly without switching from form back to the list. 

4. Testing

For business processes where performance is critical or processes having complex customizations with very high volumes, it is strongly recommended to plan for performance testing. Consider reviewing the below technical talk series describing important performance considerations, as well as sharing practical examples of how to set up and execute performance testing, and analyze and mitigate performance issues. Reference: Performance Testing in Microsoft Dynamics 365 TechTalk Series – Microsoft Dynamics Blog

5. Monitoring

You should define a monitoring strategy and might consider using any of the below tools based on your convenience.

  1. Monitor Dynamic 365 connectivity from remote locations continuously using network monitoring tools like Azure Network Performance Monitor or 3rd party tools. These tools help identify any network related problems proactively and drastically reduce troubleshooting time of any potential issue. 
  2. Application Insights, a feature of Azure Monitoris widely used within the enterprise landscape for monitoring and diagnostics. Data that has already been collected from a specific tenant or environment is pushed to your own Application Insights environment. The data is stored in Azure Monitor logs by Application Insights, and visualized in Performance and Failures panels under Investigate on the left pane. The data is exported to your Application Insights environment in the standard schema defined by Application Insights. The support, developer, and admin personas can use this feature to triage and resolve Telemetry events for Microsoft Dataverse – Power Platform | Microsoft Learn
  3. Dataverse and PowerApps analytics in the Power Platform Admin Centre. Through the Plug-in dashboard in the Power Platform Admin Center you can view metrics such as average execution time, failures, most active plug-ins, and more.
  4. Dynamics 365 apps include a basic diagnostic tool that analyzes the client-to-organization connectivity and produces a report.
  5. Monitor is a tool that offers makers the ability to view a stream of events from a user’s session to diagnose and troubleshoot problems. Works both for model driven apps and canvas apps. 

I hope this blog post had helped you learn or know something new…thank you for reading…

Cheers,

PMDY

Email templates showing Xml – Quick Tip

Hi Folks,

We recently came across a situation where the new and existing email templates keeps showing a xml as below.

This kept us annoying as already the existing ones are created using Rich Email Template editor. At first check, we verified in our Dev and SIT, badly we saw that this is same in both the environments. We double confirmed that no changes were made to the OOB Email template form, so we doubted that there was something wrong with our environment. Luckily we have one more environment where we able to see the email templates working fine. Then we confirmed that there is related to email template form related issue. Also when we tried to open the existing email templates in new designer from https://make.powerapps.com, they opened without any issue.

Fix: Open your model driven app in your custom solution created and launch it by double clicking on it. Just verify it the forms selected for Email Template entity….

The fix is quite obvious and there you are..inorder for email template to show properly, you should select Default UCI Template type form.

Voila, its back as below.

Hope this useful…

Cheers,

PMDY

Power Platform..A trio..game changer…

Have u ever imagined that Microsoft will bring its all new diverse products covering Dynamics 365, Office 365 and standalone products under one roof making a Trio…to unlock the potential faster than you ever thought possible…if you were not aware…then this post is for you…

The main intention is to empower everyone with one connected app platform…Power Platform combines the robust power of PowerAppsPowerBI, and Microsoft Flow into one powerful business application platform –  providing quick and easy app building and data insights.

This is part one of 6 series blog posts helps you to understand the basics, in and out of this entire all new ecosystem. Upcoming blog posts will give you a deep insight on covering every individual aspect on this marvellous platform.

Power-platform-2

Common Data Model:

The Common Data Model (CDM) is the shared data language used by business and analytical applications. CDM bridges the gap between disjointed data repositories, granting easier cross-platform business reporting.

Copy-of-Copy-of-Common-data-service

It consists of a set of a standardised, extensible data schemas published by Microsoft and partners that enables consistency of data and its meaning across applications and business processes. This allows apps to integrate and share data with each other without the need for extensive, custom integration by providing a centralized point where systems can come together and connect.

The Common Data Model is a secure method for exposing Microsoft databases that allows developers to build custom connections with other databases.

Common Data service:

The heart of the Microsoft Power Platform is the Common Data Service for Apps(CDS). These applications handle your data through the use of Microsoft’s Common Data Service for Apps (CDS). CDS is a cloud-based tool hosted on Azure which allows you to securely store and manage your business data. Data within the CDS is stored within a set of entities, a standard set of entities are included, however custom entities can be created for specific requirements to your organization and populate them with data using Power Query. The CDS for Apps is built on the Common Data Model.

Dynamics 365 applications, like Dynamics 365 for Sales, Service or Talent also use the Common Data Service to store and secure data used by the applications. This enables you to build apps using PowerApps and the Common Data Service directly against your core business data already used within Dynamics 365 without the need for integration. You can think of Common Data service as a common store allows for an easier app building experience, and a single set of logic to maintain and operate over the data.

Power Apps:

Power Apps enables users fostering via No Code solutions which improves productivity and reduces the time for the delivery.

image15

PC Mag. had rated the power apps as the best low code solutions available in the market..if you haven’t gone through this..read this article..

PowerApps at its core is a Platform as a Service. It allows you to create Mobile Apps that run on Android, iOS, Windows (Modern Apps) – and with almost any Internet browser..Read more about Power Apps in the upcoming blog post here

Microsoft Flow:

Microsoft Flow is an online workflow service that automates actions across the most common apps and services and a trigger based system.microsoft-flow-templates

In total there are connectors for 323 applications and protocols at the time of writing, and you can write your own if you need a different one. You can read more about Flow and automating your business processes here…

Power BI:

Microsoft Power BI is a collection of software services, apps, and connectors that work together to turn your unrelated sources of data into coherent, visually immersive, and interactive insights. Power BI can be simple and fast, capable of creating quick insights from an Excel workbook or a local database.

sCM_Power-BI-Preview

At the users flexibility….we can use…Windows desktop application called Power BI Desktop, an online SaaS (Software as a Service) service called the Power BI service, and mobile Power BI apps that are available on Windows phones and tablets, and also on Apple iOS and Google Android devices.

These three elements—Desktop, the service, and Mobile apps—are designed to let people create, share, and consume business insights in the way that serves them, or their role, most effectively.

Read more capabilities of Power BI here…

Connectors & Gateways:

Nevertheless we discussed all the other components as part of this framework, connectors and gateways plays a major role…Connectors are essentially proxy wrappers around the APIs provided by services that allow Microsoft Flow, PowerApps and Logic Apps to easily interact with the service. You can read more about connectors and gateways and much more in upcoming post…

That’s it for today…thank you for reading…

Cheers,

PMDY

Unlock the lookup fields in a business process flow in D365

Problem statement:

Recently while working on issue in Dynamics 365, found that all the lookup fields included in a stage in the Business process flow are locked out and not able to edit and we were not able to move to next stage since these fields are mandatory. We modified to show the stage owner properly, but even though when that stage owner logged in these lookup fields used in the Business process flow are locked.

Solution:

Give Append and AppendTo privileges to the other entity so that these fields would be unlocked and at the same time you need to give read privileges on the related entity so that user could see this lookup field without any permission issue, you need to give write privileges too in order to edit and write data in to that field.

Hope this helps someone…

Cheers,

PMDY

Open source tools, Solutions available for Developers and Admins

So today, I would like to give you a list of most useful tools available till now for Dynamics CRM which increases the developer productivity and helps Admins.

Some great tools you should check out to see if they could work in your organization.
  1. Fiddler – web debugging proxy
  2. Task Workflow Tools – custom workflow steps to extend your workflows
  3. Mobile Task Flows – walk users through tasks in the mobile or phone app
  4. Ribbon Workbench – visually edit the ribbon
  5. CRM Bookmarklets – JavaScript saved as bookmarks to “hack” your CRM (edit read only fields, show hidden fields, etc.)
  6. XRM Toolbox – It was shipped with 20 84  plugins as of April 2018 to handle several administration, customization or configuration tasks. Wiki
    • Access Checker
    • Assembly Recovery Tool
    • Attribute Bulk Updater
    • Audit Center
    • FetchXml Tester
    • Bulk Form Attribute Manager
    • FLS Bulk Updater
    • Form Libraries Manager
    • Form Parameter Manager
    • Import/Export NN relationships
    • Iconator
    • Metadata Browser
    • Metadata Document Generator
    • Privileges Discovery
    • Role Updater
    • Script Finder
    • SiteMap Editor
    • Solution Components Mover
    • Solution Import
    • Solution Transfer Tool
    • Sync Filter Manager
    • Synchronous events execution order editor
    • Easy Translator
    • User Roles Manager
    • User Settings Utility
    • View Layout Replicator
    • View Transfer Tool
    • Web Resources Manager
  7. Metablast – visual utility for exporting metadata
  8. CRM Snoop – Plugin Troubleshooting tool
  9. LinqPad – Easily run .NET code
  10. CRM DevTools – Chrome extension visible in the F12 developer area with lots of helpful functions for admins. It is worth it just to remember the debug and diagnostic links
  11. KingswaySoft – SSIS Integration toolkit
  12. Developer tool kit – New developer tool kit which was officially released
  13. Microsoft Fakes framework to unit test your CRM Code  – Test your undeveloped CRM Custom code using Microsoft Fakes framework
  14. CRM JavaScript Web API Service Utility – Used to write the latest javascript code using Web API
  15. Link Buddy –  It’s useful for converting logging/tracing details from CRM plug-ins, custom apps, etc. into click-able links that open the CRM record for which the GUID represents.
  16. MS CRM Security Roles to Excel Export – A Tool to export CRM Security roles into a Excel workbook.
  17. FetchXML Tester Online – Allows you to test FetchXML queries online without importing any solution or downloading any separate application.
  18. ILMerge – a .NET tool/utility which merges a number of dll’s into one dll, which is useful for creating plugins for online CRM.
  19. Tool to track performance – Check the CRM latency and bandwidth at https://CRMUrl.com/tools/diagnostics/diag.aspx (make sure to replace CRMUrl.com with the actual CRM URL).
  20. Convert FetchXML to SQL query – people find difficulties in converting the fetch xml query created from advanced find to a SQL query to retrieve records from Backend, use this tool to help the same
  21. Convert SQL query to Fetch XML – Two way round, use this to convert your backend queries to fetch XML to use them in your Code to retrieve data and metadata.
  22. Diagnostics Tool for On premise – Helps CRM developers and administrators to enable trace and devErrors on CRM server. Whereas its name only mentions CRM 2011, it is compatible with CRM 2013 and 2015 too (OnPremise only)
  23. Fetch XML Formatter 1, Fetch XML Formatter 2– Two similar tools for the same functionality, use according to your convenience. These were lightweight windows application that tool will be help you when you are extensively working with FetchXML in Javascript / C# code to get desired result. Takes fetchXML from Advance Find as an input and convert that into desired format, which can be used into Javascript / C# for further coding.
  24. Local option set to Global optionset converter – It’s purpose is to automate the task of converting a Local Option Set (an option set that is defined by and specific to a single entity. e.g. a CRM 4.0 Picklist), into a Global Option Set.
  25. Win Merge – A great tool to compare customizations.xml files taken from solutions
  26. CRM Rest Builder – A tool for CRM 2011/2013/2015/2016 Online & On Premise to generate JavaScript code using the 2011 & Web API REST endpoints.
  27. CRM Visual Studio Code JS Snippets – JavaScript code snippets for Dynamics 365/CRM 2011 – 2016 (5.0 – 8.2)
  28. TableTools2 – Add on for only Mozilla firefox to improve the CRM Grids. You can use the addon in grids that don’t display a filter or just in general with any page that displays a table like structure.
  29. CRM Theme Generator – Use this tool to generate the feature and create themes in CRM, supporting latest versions
  30. Advanced Query outer Join – Plugin to enable outer join queries from Advanced Find. This plugin enabled you to do that. The plugin runs on pre-RetrieveMultiple and alter the query that gets sent to the pipeline, with the correct outer join conditions
  31. Easy VS Code in Action – Use this to work with JavaScript file types from your desktop itself and without opening visual studio
  32. Custom code validation tool – Between CRM 2015 and CRM 2016 there are no differences for the checking of unsupported customizations of Js code, so if you get results to fix with the 2015 custom code validation tool means that you need to fix as well for 2016
  33. CRM DevTools – from Sonoma Partners is a Chrome extension which quickly provides CRM record and environment information and makes troubleshooting and testing so much easier. Once it’s installed, you can access the features by going to the Chrome DevTools (F12 key) and clicking the CRM DevTools tab.
  34. Solution to Create “Does Not Have” Queries using Advanced Find – This solution allows you to create “does not have” or “does not exist” queries using the standard Advanced Find interface.
  35. Dynamics 365 developer extensions(tool kit) – Tool to search for CRM related MSDN content, and tooling to assist with managing and deploying web resources, plug-ins, and reports
  36. Network Visualisation tool – Visualize the relationships between accounts, contacts and activities in a network graph, refer to this video to get insights
  37. Level up for dynamics CRM – Works with Edge and Chrome only. Gives form helpers and Navigation helpers, an amazing tool
  38. Personal view to System view – use this to convert created personal view to system view
  39. Beautify your JS, JSON code – improve the readability of your JS code, even minify your code
  40. Ribbon workbench 2016 – Most user friendly and universally accepted tool to customize ribbon, note that this version don’t need Silverlight within your browser
  41. ilspy – Used to decompile your source code from your .NET DLL, helpful to find your source code from plugin DLL’s
  42. Autonumbering solution – free autonumbering solution used to generate a Unique Reference Number for new records so they can easily be tracked, and is also useful for integrations.
  43. ReSharper – on the fly code analysis, identifies problems and provides quick fixes, best addin to visual studio
  44. Integrate Microsoft Dynamics CRM – Find the ETL tools and other key useful integration tools supported from MSDN.
  45. Call workflows and actions using Javascript – Use this tool to call workflows and actions using JavaScript without much hassles without too much taking care of code.
  46. Scribe Insights – Good data migration platform to move data between two systems and create new records in MS CRM. Reasonably the best in terms of performance with such a kind of UI and easy to learn. Comes with one month free trial.
  47. SOAP UI – Most widely used tool for testing web services and other API’s without much hassles.
  48. DLL Extractor – Extract your plugin DLL’s located on your CRM Database, this applies only for On premise applications. Login to your Client network and specify the server and database name with Integrated security or SQL Authentication. Click on List Plugins which shows the assemblies registered and download the                    required ones.
  49. Portal Checker – Troubleshoot your Dynamics 365 portals
  50. Autonumber No Code solution – Autonumbering generation solution.
  51. Commander – is a pre-configured software package that provides you with an awesome terminal emulator, and best shell you’ll ever have on Windows
  52. GuidGen – GuidGen is Microsoft recommended tool which programmatically generates GUID’s.

Hope you found some tool which had increased your productivity developing CRM…

Cheers,

PMDY