5 Replies Latest reply on Feb 14, 2011 2:15 PM by philmodjunk

    Portal inside another portal or List function.....?

    AlexTorry

      Title

      Portal inside another portal or List function.....?

      Post

      Hi,

      Hope anyone can help me here, the thing is i have an invoice recording portal with multiple line items to choose from different products working fine as you can see on the picture, but then i have another portal on the customers table to report the costumer's payment history, so i was wondering if it is possible to display in one portal row the multiple line items from the invoices portal.

      I only get the first portal row displayed, as shown on the picture too, is there any way to put a portal inside another portal or what would you suggest to acomplish my objective????

      Thanks in advance!

      Captura_de_pantalla_2011-02-13_a_las_11.37.20_AM.png

        • 1. Re: Portal inside another portal or List function.....?
          philmodjunk

          You cannot place a portal inside a portal in FileMaker. That option won't work.

          What you can set up are synchronized MainRecord - DetailRecord portals. When you click a row (or a button in the portal row) in the MainRecord portal, it Highlights via a conditional format and a script pulls up the matching detail records in a second portal. In FileMaker 11, this approach can be done with a portal filter.

          In older versions, this can be done with a "filtered relationship" where the script modifies a field in the parent record to control which "detail" records appear in the portal.

          • 2. Re: Portal inside another portal or List function.....?
            AlexTorry

            Didn´t get it, how would i acomplish that, if you could please be more specefic, thanks again!

            • 3. Re: Portal inside another portal or List function.....?
              philmodjunk

              I didn't get more specific as the explanation is fairly long. I'd prefer not to post two long descriptions of this approach--one for Filemaker 11 users and one for older versions.

              Which version of FileMaker are you using?

              • 5. Re: Portal inside another portal or List function.....?
                philmodjunk

                Good, that's the simpler example to give.

                Let's assume you have these three tables and relationships:

                Master, Child, ChildDetail.

                Master::MasterID = Child::MasterID
                Child::ChildID = ChildDetail::ChildID

                On a Master based layout, add portals to Child and ChildDetail. Define this Portal Filter for ChildDetail:

                $$ChildID = ChildDetail::ChildID

                Write this script:

                Set variable [$$ChildID ; Value: Child::ChildID ]
                Refresh Window [Flush cached join results]

                Attach this script to either a button located in the Child Portal row or you can select all the portal row fields and use Button setup to turn the entire row into a button that performs the above script. (The second option allows you to just click a portal row to select the detail records in ChildDetail, but you can no longer edit the fields by clicking into them so use the option that works best for your layout needs here.)

                Now one last detail. You can set a conditional format on all the fields inthe Child portal row with an expression like this:

                $$ChildID = Child::childID

                And specify a a light pastel fill color to "highlight" the currently selected portal row in the Child Portal to make it easier to see to which Child records, the currently visible ChildDetail records belong. (You can also specify a bold text style and/or a different text color.)