Wednesday, 5 March 2014

List Down All JavaScript files and the Attached Forms with SQL Query

We can join DependencyNodeBase and DependencyBase tables to get the list of all JavaScript files and the Attached Forms in SQL Query.

 SELECT DISTINCT WebResource.Name, Entity.Name, SystemFormBase.Name  
 FROM DependencyNodeBase RequiredComponent  
 INNER JOIN WebResource ON WebResource.WebResourceId = RequiredComponent.ObjectId  
 INNER JOIN DependencyBase ON RequiredComponent.DependencyNodeId = DependencyBase.RequiredComponentNodeId  
 INNER JOIN DependencyNodeBase DependentComponent ON DependentComponent.DependencyNodeId = DependencyBase.DependentComponentNodeId  
 INNER JOIN SystemFormBase ON SystemFormBase.FormId = DependentComponent.ObjectId  
 INNER JOIN Entity ON Entity.ObjectTypeCode = SystemFormBase.ObjectTypeCode  
 WHERE WebResource.WebResourceType = 3 -- JavaScript  

For CRM Online or those who doesn't have access to SQL, you might have to develop a console application to Get list of all Web Resources and loop through the collection and Track Dependency for each component.

No comments:

Post a Comment