In my previous article, I described how to tag attributes as dependencies with JavaScript to make sure no one can delete those attributes and even if someone remove them from form, we should be able to access their values in JavaScript.
Another cool feature introduced with Dynamics 365 V9.0 is to have dependent JavaScript files. Prior to V9.0 if we have JavaScript web resource which depends on 3rd party script library, we have to load 3rd party script as well on form and it should be up in order. This become an issue when JavaScript is used for multiple entities with multiple forms.
Using this new feature, you would be able to define dependent JavaScript files while creating a new web resource or updating existing as shown below:
Once you add dependent JavaScript file, it will be automatically loaded along with main JavaScript file and you do not need to add it explicitly on form.
Points to remember:
- Dependent files works with JavaScript on form and ribbon button
- Dependent files cannot be deleted
- Solution import will fail if dependent files are not included with message “missing required components”
References: