6 Replies Latest reply on Nov 9, 2012 12:35 PM by Jeremy Feist

    finding broken "contains" links

    Jeremy Feist

      a while back we need to do a roll back on one of our common parts. we thought we had repaired all of the assemblies where it was used, but found one today that we had missed. we now need to re-check all of those assemblies. I have a list of the assemblies (in excel).

       

      what would it take to have something (a report, some API, or ??) go though the list, pull up each file, check the contains tab to see if the file is listed, and spit out a list of yes/no results?

        • Re: finding broken "contains" links
          Raghavendra Bhagwan

          Hello Jeremy,

           

          Did you try using the report generator in EPDM ?

           

          Attached is the sample report examples.crp file. Just import this to report generator by Tools>Report generator > Import.

           

          Once you import, select the  Documents Referenced by Documents query by selecting the checkbox provided.

           

          You have to select the vault as the folder to search for and in the next dialogue box enter the filename with the extension and click ok.

           

          The results are displaye below and you could export or save the results to .csv and you can compare the results with your excel file by using vlookup.

           

          Hope this helps !

           

          Raghav.

            • Re: finding broken "contains" links
              Jeremy Feist

              nope.

               

              1) from its name this would just return the contains info for the selected file(s). which is promising but...

              2) getting the entire list of assemblies into the selecetion list would take about as long as manually searching for and selecting them to view the contains tab. and...

              3) it doesn't return anything for any of the permutations of imputs I have tried.

            • Re: finding broken "contains" links
              Lee CS Young

              It's possible using SQL and the API.  Personally I would use the API and write a small program to handle this. (If you do it once, you'll likely need it again.) This query might help you for a quick out though.  (Or maybe not.)

               

              DECLARE @ReferencedDocumentID INT
              
              SELECT @ReferencedDocumentID = d.DocumentID
              FROM Documents d
              WHERE d.Filename = 'YourReferencedDoc'
              
              SELECT x2.DocumentID
                  ,d.[Filename]
                  ,x2.XRefDocument
                  ,x2.RevNr
              FROM (
                  SELECT xrefdocument
                      ,MAX(revnr) LastRevNr
                  FROM XRefs
                  GROUP BY XRefDocument
                  ) AS x
              JOIN xrefs x2 ON x2.XRefDocument = x.xrefdocument
                  AND x2.RevNr = x.LastRevNr
              JOIN Documents d ON d.DocumentID = x2.DocumentID
              WHERE x2.XRefDocument = @ReferencedDocumentID
                  AND d.[Filename] IN ('<filename1>','<filename2>', 'etc')
              

               

              The list is comma separated of course. Use your favourite text editor to make your excel list comma separated.