Dataverse Code Review Guidance for Resilient Applications
Code Reviews are helpful to identify violations in customizations.
Organizations can run a code review called Solution Checker against their solutions. I recommend reviewing the last time Solution Checker was run. If its been a while or a recent code release was performed, run Solution Checker again. Ideally, Solution Checker is run on each commit or extraction from a development environment.
- Enable Managed Environments for Dynamics 365 production environments.
- Enable Solution Checker enforcement on test or build environments.
- Track analysis results and assign work items for each.
Rule | Notes |
---|---|
Avoid duplicate Dataverse plug-in registrations | Can create SQL deadlocking Query Link |
Remove deactivated or disabled customizations | Carrying unneeded code can cause confusion and slow deployments |
Interact with HTTP and HTTPS resources asynchronously | Browsers are moving away from sync calls |
Avoid Modals | Deprecated |
Avoid DOM Form | Not supported |
Avoid DOM Form Events | Not supported |
Avoid CRM 2011 OData | Deprecated |
Avoid CRM 2011 SOAP | Deprecated |
Avoid Browser Specific APIs | IE or legacy browser functionality should be removed |
Avoid Unpublished Functionality | Can be flaky and cause code to break |
Avoid window.top | Not guaranteed to be correct DOM level |
Use Relative URI | Can hard code incorrect url |
Use Navigation API | Deprecated |
Use Client Context | Deprecated |
Use Offline | Deprecated |
Do not make parent assumption | Can be flaky and cause code to break |
Use Org Setting | Deprecated |
Use Global Context | Deprecated |
Use Grid API | Deprecated |
Use Utility Dialogs | Deprecated |
Avoid IsActivityType | Deprecated |
Avoid SilverLight | Deprecated |
Use STRICT mode | Helps with resiliency of JS |
Use strict equality operators | Helps with resiliency of JS |
Avoid with | Deprecated |
Use App Side Pane API | Deprecated |
Address HIGH formula issues with Canvas Apps | |
Avoid AutoStart in Canvas Apps |
Organizations can track the results of Solution Checker through Analysis Jobs. The list above is a great place to start to assess your production solutions resiliency.
//Check analysis jobs within a specific environment
https://[org].crm.dynamics.com/api/data/v9.1/msdyn_analysisjobs
//Check analysis results within a specific environment
https://[org].crm.dynamics.com/api/data/v9.1/msdyn_analysisresults
//Check Results for a specific solution name (analysis component)
https://[org].crm.dynamics.com/api/data/v9.1/msdyn_analysisresults?$filter=msdyn_AnalysisComponentId/msdyn_componentname eq '<solutionName>'