find all javascript web resources at a form

MS CRM 2013

Hi folks,

Yesterday I had the following interesting question: “How get I all the referenced JS files per entity and form and this at the glance”?
(The scripts finder into the XRM-Toolbox was not strong enough)

So I went to the database and wrote a little cute SQL Statement. (unfortunately only suitable for OnPremise System)

And here it is:


Forms.Name, Forms.WebResourcePath, sol.FriendlyName, ev.LogicalName

FROM (SELECT a.ObjectTypeCode, a.Name, b.Node.value(‘(.)’,‘NVARCHAR(max)’) AS WebResourcePath

FROM (SELECT sf.FormId, sf.Name, sf.ObjectTypeCode, CONVERT(xml,sf.FormXml) as Form 

FROM [dbo].[SystemForm] sf

WHERE sf.Type = 2) AS a
OUTER APPLY a.Form.nodes(‘//Library/@*[local-name(.)=”name”]’) b(Node)) AS Forms
INNER JOIN [dbo].[FilteredWebResource] fwr ON ( = Forms.WebResourcePath)

INNER JOIN [dbo].[EntityView] ev ON (ev.ObjectTypeCode = Forms.ObjectTypeCode)

INNER JOIN [dbo].[Solution] sol ON (sol.SolutionId = fwr.solutionid)

WHERE Forms.WebResourcePath IS NOT NULL

ORDER BY ev.LogicalName, sol.FriendlyName


No comments yet.

Leave a Reply