D365 / Power Platform blog

Home » How-To » Dynamics 365 » Adding dependencies Javascript in Dynamics CRM (Avoid dysfunctional JavaScript)

I guess once upon a time or even multiple times you have got an error regarding your javascript in Dynamics 365. Sometimes it could be regarding a field you use is getting removed, other times it could definitely be a dysfunctional JavaScript.

In Dynamics 365 Web Resources you have the option to add dependencies, in a Javascript web resource it could be ideal to add the fields you are using as dependencies. By doing this you will not be able to delete the field or the Javascript unless the dependency is removed.

To add a dependency to your Javascript. navigate to your javascript and click “Dependencies”

Click “Add” in the bottom section
Add the fields that are dependent on your Javascript, in my situation the status code field is used, and as of that dependent.

Now you will not be able to delete the depended fields before you remove the dependency. You are not able to import this Javascript to another environment without the field already being installed.

Share this post

Scroll to Top