2 Replies Latest reply on Jun 27, 2013 12:41 PM by deathrobot

    Showing multiple grandchildren in a portal row

    deathrobot

      Title

      Showing multiple grandchildren in a portal row

      Post

           On my relationship graph I have 3 tables:

           Grandparent -> Parent -> Child

           Each record in the Grandparent table has from 1 to 10 children (from the Parent table). Each record in the Parent table has from 1 to 3 children (from the Child table). On a layout in the Grandparent table, I have a portal showing the related records from the Parent table. As one of the portal fields, I would also like to see all related grandchildren in the form "grandchild01, grandchild02, etc.")

           What's the best way to accomplish this? I'm assuming it makes most sense to have this field reside in the Parent table and that I could use a script to add info to it whenever I made a new record. Or would a calculation make sense (not sure what it would be, though)? Or is there some other, more direct way?

           Thanks,

           Michael

        • 1. Re: Showing multiple grandchildren in a portal row
          philmodjunk

               You might want to consider two portals a "master" portal to Parent and a "slave" or "detail" portal to Child. Using scripts and buttons, when you click on a portal row in the portal to Parent, just the children of that one parent appear in the detail portal. See this thread for details: Need layout solution for nested portals...

               If you only need to list data from a single field in Child, you may want to define a calculation field in Parent with this expression:

               Subsitute ( List ( Child::childField ) ; ¶ ; ", " )

               This produces a comma delimitted list of values from ChildField in a single field.

               In FileMaker 12, the same result can be produced with ExecuteSQL.

          • 2. Re: Showing multiple grandchildren in a portal row
            deathrobot

                 Thanks PhilModJunk. The substitute calc is perfect in this particular case. Will also read through the other post about portals in case it helps me elsewhere in my solution.

                 Best,
                 Michael