You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Pages with secondary pages that use a field

2 replies [Last post]
Guest's picture

Is there a way to determine all the pages with a secondary page with a specific field ?

For e.g. if I am looking for emplid field and determine that the emplid field is used on say 5 secondary pages.

I now need to tie those secondary pages to the pages .

Is there a sql that can be run to identify such pages ?

CompShack's picture
User offline. Last seen 6 years 1 week ago. Offline
Joined: 12/09/2007
Posts: 167
Look at table PSPNLFIELD

I didn't have much time to test this but it will give you a good start. The 1st select will get all pages that have secondary pages on them (thus the fieldtype <> '11' - fieldtyp 11 means it is a subpage and you want secondary pages) and the 2nd select will look for a specific field on secondary pages found.

Please test it and let us know if it works!

WITH my_data AS
     (SELECT   pnlname, fieldtype, subpnlname
          FROM pspnlfield
         WHERE (subpnlname <> '' OR subpnlname <> ' ') AND fieldtype <> '11'
      GROUP BY pnlname, fieldtype, subpnlname)
SELECT   my_data.pnlname, my_data.subpnlname
    FROM my_data, pspnlfield FIELD
   WHERE my_data.subpnlname = FIELD.pnlname AND FIELD.fieldname = 'Your-field'
GROUP BY my_data.pnlname, my_data.subpnlname
ORDER BY my_data.pnlname, my_data.subpnlname;

HH's picture
HH (not verified)
Works like a charm :)

Works like a charm!