Dynamics CRM 365: WebResource Dependencies

The common routine that we will do in custom RibbonButton is adding the library that we want to use. Let’s say we have a function onCallButton on JavaScript A. But inside the function onCallButton, we have called to another JavaScript B. Hence we need to register JavaScript B to be loaded when we click that button.

This is how we load the JavaScript library:

define-library

We use Enable Rules in Ribbon Editor and we put information about the file we want to load and use isNaN function to force the Ribbon to load our JavaScript.

Now in CRM 365, we can put our dependencies in the JavaScript itself.

define-dependencies

With this feature, CRM will load automatically our dependencies which is more convenient to use compared to the old way.

Source:

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/web-resource-dependencies

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.