JavaScript Upgrade Strategy #13: Remove Unused Web Resources

Speaking of feature creep, web resources are one of the few system-level data items that can sort of build-up over time, if not properly maintained. Again, this happens because of a change in business direction, a rewrite of functionality, etc.

Most of the time, these unused web resources cause no problems at all, other than to just be taking up space. But occasionally, you run into issues, like I did on one client project, where you don’t actually know which web resources were used and which were not.  I had to go through each one, and check their dependencies to see if they were referenced anywhere.  This applied to both images and JavaScript, with the JavaScript being the most concerned.


Checking Dependencies

Dynamics CRM has a built-in dependency checker so you can see if your development resources are being used elsewhere in the system. While working with a solution, any time you see the Show Dependencies button, you can perform this operation.

In the case of a web resource, all you have to do is highlight the web resource and click the Show Dependencies button:



If there are dependencies, they will be shown in the dialog below:



The only time I have seen this feature not work was in Dynamics CRM 2011 where JScript web resources associated with a Ribbon Button were not properly identified.  I think that was corrected in a later version.

Leave a Reply 0 comments