locked
Find all related Forms for Web Resources? RRS feed

  • Question

  • I've run a SQL query against the Webresources table to filter out all JavaScript files.   Does anyone know which table(s) I can join to find all Forms that the files are attached to?
    Tuesday, March 4, 2014 7:39 PM

Answers

  • You've got to join DependencyNodeBase and DependencyBase tables to get the required data.

    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

    • Marked as answer by Cipher Wednesday, March 5, 2014 3:01 AM
    Wednesday, March 5, 2014 2:22 AM

All replies

  • You've got to join DependencyNodeBase and DependencyBase tables to get the required data.

    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

    • Marked as answer by Cipher Wednesday, March 5, 2014 3:01 AM
    Wednesday, March 5, 2014 2:22 AM
  • Thanks, Linn.  That worked perfectly.
    Wednesday, March 5, 2014 3:02 AM