5 Replies Latest reply on Jun 29, 2015 3:12 PM by jbell2355

    Displaying specific child records in layout

    jbell2355

      Title

      Displaying specific child records in layout

      Post

       

      I have a situation that I would like to display some specific information from a child record in a layout based on some certain criteria. 

      For example I have parent record "A" who has ten child records with a specific codes in one of the fields. I would like to display information on the parent record layout where the field code matches a predetermined code.  To further clarify I hope, Parent record "B" will also have child records with similar codes to be matched to.  I have thought about using global variables, calculation fields in the parent record and such to match them up.  I'm my mind in simple terms the code would look like this:

      If( child record: field 1 = code a) then display information from that specific child record.

      It would almost seem to me that I would want to loop through the child records to find the match.  The other thought I have had is to use the relationship graph, but it seemed to me that it would get cumbersome, because I would have at least an additional 5 relationships.  I hope this makes sense.  I have attached a copy of the graphic that I am trying to populate with filemaker data for reference.

      Essentially although I may have 10-20 child records, I only want to show information from 5-6 specific records based on a predetermined criteria.  Things I am trying to populate from the child records would be package information container fields for packages 1-5 and their pricing.

      Thanks in advance for the help  

       

      image.jpg

        • 1. Re: Displaying specific child records in layout
          philmodjunk

          When I read that, it's not exactly clear to me what you want.

          From a given parent record, (Is the layout an attempt to show that parent?), do you a) want to see all child records related to that parent that have a particular code? or b) all records from the child table that have a particular code whether they are normally linked to the current parent record? or c) situation a) but just some aggregate data (sums, counts, averages...)? or d) situation b) but just aggregate data?

          a) and c) can achieved with a filtered portal that filters for the additional value in most cases

          b) and d) would most likely use a new table occurrence of the child with a match field that matches for the specified code

          And there are also ways to use ExecuteSQL for c) and d)....

          • 2. Re: Displaying specific child records in layout
            jbell2355

            Sorry for the confusion.  Let me try and clarify as best I can.  In the image posted previously there are boxes for package 1, 2, 3, etc...  The Child records would have corresponding codes ie 1,2,3, etc...  From these child records I would like to retrieve a corresponding container field, and price to be filled in dynamically based on the matching codes.  I am attaching a copy of the previous image with more notes on it to better clarify what I am trying to do.  However, the one comment that peaked my interest as it seems it may work based on my limited understanding of ExcuteSQL is using that command.  I am not 100% sure how I would go about it, but from my days way back when working with MySQL it seems like it might work.

            I am uploading a simple copy of the current relationship as well.  Mine has an extra piece in the middle, but the concept would work with or without the middle piece I assume. 

            • 3. Re: Displaying specific child records in layout
              jbell2355

              Phil, 

              Thank you again for the quick response.  here is the second file.

              • 4. Re: Displaying specific child records in layout
                philmodjunk

                I'm sorry but I'm still asking questions. Your relationship shows three table occurrence boxes. Which is specified in Layout setup | Show Records From for the layout screen shot shown?

                What I see doesn't look quite right for what you want to do as using either the left or center TO's would have issues for what you want to show.

                I suspect that the Package options you want to show at top left can be produced with one row portals that each filter for a different "code", but I don't yet have enough info to be sure.

                A picky but important detail: ExecuteSQL() is a function used in a calculation, it's not a command. There is a similarly named script step, but it's not one you'd want for this purpose.

                • 5. Re: Displaying specific child records in layout
                  jbell2355

                  I suspect that the Package options you want to show at top left can be produced with one row portals that each filter for a different "code", but I don't yet have enough info to be sure.

                  Thank you Phil!.  I was making it more complicated than it needed to be.  The single Portal Row works perfect and can be easily modified based on my needs.  Sorry for the long delay in my response as I have been away from my computer for a little bit.  Much appreciated.