Top 20 Best Practices in Dynamics 365 & Power Platform while working with plugins, custom workflows, javscript, web resources
Here you will find some important best Practices you can folow while working with Power Paltform and Dynamics 365 Apps. All these Best Practices are recommended by Microsoft for better solution management and performance.
- Plugin Best practice
- Custom Workflow best Practice
- Workflow best Practice
- Configuration best practice
- Customization best practice
- integration best practice
Sl No. | Description |
---|---|
1 | Avoid duplicate Dataverse plug-in registrations. Duplicate plug-in step registration will cause the plug-in to fire multiple times on the same message/event. This could lead to: – Delayed processing of asynchronous jobs when registered as an asynchronous execution mode. – Degraded user performance experience when registered as a synchronous execution mode. – Unresponsive model-driven apps – Slow client interactions – The browser stops responding |
2 | Include filtering attributes with Dataverse plug-in registrations. If no filtering attributes are set for a plug-in registration step, then the plug-in will execute every time an update message occurs for that event. A combination of no filtering attributes and auto-save functionality could lead to unnecessary plug-in executions causing undesirable behavior and degrade performance. |
3 | Use caution with Dataverse plug-ins registered for Retrieve and RetrieveMultiple messages. Adding synchronous plug-in logic to the Retrieve and RetrieveMultiple message events can result: – Unresponsive model-driven apps – Slow client interactions – The browser stops responding |
4 | Remove deactivated or disabled customizations Deactivated or disabled customizations should be removed from a solution to improve solution management and to decrease the risk of utilizing or managing an outdated component. |
5 | Interact with HTTP and HTTPS resources asynchronously. Synchronous requests block the execution of other scripts, which can cause the following: Unresponsive model-driven and canvas apps Slow client interactions |
6 | Avoid using modal dialogs. Use Xrm.Navigation API |
7 | Don’t use the Document Object Model (DOM) of model-driven apps directly. This isn’t a supported approach in Dynamics 365 or Power Apps. Use the supported Client API obje8ct model instead. |
8 | Don’t register or unregister handles to the Document Object Model (DOM) events of model-driven apps. This isn’t a supported approach in Dynamics 365 or Power Apps. Use the supported Client-side event handlers instead. |
9 | Don’t target the Microsoft Dynamics CRM 2011 OData 2.0 endpoint. There are no immediate symptoms, but code that uses this endpoint will stop working when the deprecated endpoint is removed. You should change any code that depends on the Organization Data Service (OData v2.0) to use the Dataverse Web API (OData v4.0) endpoint instead. For model-driven apps, you should use the Xrm.WebApi (client API reference), which provides access to the Dataverse Web API for client-side extensions that use JavaScript web resources. |
10 | Don’t target the Microsoft Dynamics CRM 2011 SOAP services. |
11 | Don’t use Internet Explorer legacy APIs or browser plug-ins. |
12 | Don’t use the deprecated Microsoft Dynamics CRM 2011 object model. Instead follow Dataverse Web API documentation. |
13 | Don’t use Xrm.Page . use Form Context. Although Xrm.Page is deprecated, parent.Xrm.Page will continue to work with HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource. |
14 | Use strict mode when possible. |
15 | Don’t use the ‘eval’ function or its functional equivalents. |
16 | Don’t use the ‘alert’ function or its functional equivalents. |
17 | Avoid using refreshRibbon in form onload and EnableRule. |
18 | Use delayed load in some scenarios to improve performance. |
19 | Insecure protocols such as HTTP or FTP should be replaced by their encrypted counterparts (HTTPS, FTPS) to avoid sending potentially sensitive data over untrusted networks in plaintext. |
20 | Direct calls to method html() often (e.g. in jQuery framework) manipulate DOM without any sanitization and should be avoided. Use document.createElement() or similar methods instead. |
You can get the exhaustive list of Best Practices from Microsoft site Here.
Hope this helps.