Dynamics 365 Best Practices
Dynamics 365 Best Practices
Partner Architect
Program
Performance optimization
and best practices
Jason du Plessis
Senior FastTrack Solution Architect
Session Purpose and Expectations
Prerequisites
Objectives
• Understand how the system will perform once deployed and reaches maturity
with full usage
• Customize the system in such a way that the information required for the user
is placed in right.
• Use the product features creatively to help user perform their activities
quicker
• Related web resources such as JScript, images, and stylesheets should be referenced using a
•
relative path so the version hash from the parent can be inherited.
d
https://msdn.microsoft.com/en-us/library/gg309473.aspx
Performance Recommendations - SDK
* If RCSI is enabled, NoLock is not required. // ** false parameter for ColumnSet returns only record id
Performance Recommendations - SDK
• Batches requests in a single web service call method.
• Considered when network latency impacts performance
between client (SDK App) and server (Dynamics 365)
• Commonly used for Dynamics 365/IFD Deployments
• Not recommended for Dynamics 365 OnPrem with low network latency
ExecuteMultipleRequest
CreateRequest CreateRequest
CreateRequest CreateRequest
CreateRequest CreateRequest
CreateRequest CreateRequest
Performance Recommendations - Plugins
• Disable KeepAlive when calling webservices from Plugins
• Default value = true
• Allows clients to be aware of connections timeouts avoiding attempts to use expired
sessions.
Performance Recommendations - Plugins
https://msdn.microsoft.com/en-us/library/ms536648(v=vs.85).aspx
Performance Recommendations – Client script
• Use Web storage API to cache CRM data
• The following sample shows how to incorporate this concept into requesting/caching CRM
data. The sample uses sessionStorage because it has a shorter lifetime, but localStorage
could be used if this data is highly static in nature as that will persist across browser
sessions..
function UserHasRole(roleName) {
var datakey = "datakey_" + roleName;
if (typeof (Storage) !== "undefined") {
// Get the data from cache using user-specific cache key
var res = sessionStorage.getItem(datakey);
if (!res) {
//Check if user has role and cache results
var roleres = CheckRole(roleName);
sessionStorage.setItem(datakey, roleres);
return roleres;
} else {
//check cached value
return (res.indexOf("true") !== -1)
}
} else {
//Check Security role if browser does not support caching
return CheckRole(roleName);
}
}
Troubleshooting
Performance Issues
Everything is slow!!!
Performance is multi dimensional
Location Bandwidth
Operating
Cached objects
System
Customizations Antivirus
Browser Device
Server-side
Client-side
Performance Categories
Network &
Infrastructure Hardware Server
• Data retrieval – limit the data you retrieve i.e. number of columns and number
of rows
• Calling out to external systems – will incur a network cost that is much higher
than any other execution
• A simple plugin on an entity that is affected often could be more expensive than
complex plugin on an entity this updated once a day
• Consider your integrations – they typically do large volume transactions and
plugins could cause issues at scale
• Evaluate when to use plug-in and workflow
• Write plug-ins that execute faster
• Identify plug-ins takes longer than 10 seconds to execute
• Plugins cascade – often one plugin can affect a record that executes another plugin etc.
• Identify the synchronous plug-ins, determine if it can be asynchronous. Move to Power
Automate
Questions
© Copyright Microsoft Corporation. All rights reserved.