Skip to main content

Notifications

Dynamics 365 CRM Development Standards - Customization 2

Overview

This is Customization part 2 of a series of blogs introducing the Development Standards and Best Practices to help configure and customize CRM to do so consistently, clearly, and meaningfully.

JavaScript

Introduction

D365 offers numerous OOB(Out-of-Box) features to meet custom requirements from the front end. For example, Business Rules, Roll-up fields, Calculated fields, and Process Flows.

However, in certain scenarios where you can’t get what you need from the OOB, then

JavaScript is a powerful tool to meet specific requirements.

Best Practices

  1. As a best practice, you should always define a unique namespace for your libraries to avoid having your functions overridden by functions in another library.

    var Example = window.Example || {};

  2. Group custom scripts related to an entity as opposed to global scripts, together in a single file or a series of related files and store them as a web resource.
  3. Bind <On Save> and field <On Change> events in the <On load> event, then we can see all events in one JS file.

formContext.getAttribute(arg).addOnChange(myFunction)
formContext.getAttribute(arg).addOnSave(myFunction)

4. Use session storage items to cache configuration data to avoid duplicate retrieve calls.

1207.pastedimage1681195269552v1.png

5. Avoid using synchronous data access methods, use asynchronous methods instead.

Not Recommended

  1. Don’t use getElementXX() to access the DOM elements.
  2. Don’t perform complicated functions, use Plug-In instead.

Please refer to this page for all the content. 

Dynamics 365 CRM Development Standards and Best Practices.

Comments

*This post is locked for comments