6 Replies Latest reply on Aug 22, 2011 5:00 AM by mcmartinino

    Issue with a Portal in Portal database

    madhatt

      Title

      Issue with a Portal in Portal database

      Post

      Hello all, I come here quite often but have never actually posted before.

      I hope I have a simple problem.  I have uploaded a test database to this post to illustrate my issue.

      you can get the example database HERE 

      3 tables

      1. Main Table

      2. Portal 1

      3. Portal 2

      In the Main Table layout I have 1 portal record showing "Portal 1" records.  

      In the Portal "Portal 1" I have a nested Portal record showing records from "Portal 2"

      I have the relationships setup and can add records to Portal 1 and Portal 2 only one time.... after you do it the first time you can see that there is not more "portal in portal" records for the second portal and I have no idea why?

      Screen_shot_2010-11-15_at_8.47.12_AM.jpg

        • 1. Re: Issue with a Portal in Portal database
          philmodjunk

          For starters, FileMaker won't allow you to have a portal inside of a portal. If this is what you need, you have to use a different structure such as synchronized general and detail portals.

          With such synched portals, portal one shows your portal 1 records and portal 2 shows the portal 2 records for a selected portal row in Portal 1. Clicking a button in Portal 1 triggers a script that updates portal 2 to show the correct subset of records.

          • 2. Re: Issue with a Portal in Portal database
            madhatt

            I'm not sure I completly understand?

            is there anyway you can create an example for me to follow?

            • 3. Re: Issue with a Portal in Portal database
              philmodjunk

              Let's say you have this structure to your relationships:

              Parent---<Child----<GrandChild

              Parent::PK = Child::FK
              Child::PK = GrandChild::FK

              You can put a portal to Child on a Parent layout, but you can't put a portal to GrandChild inside that portal.

              You can add a table occurrence to GrandChild and define a global field in Parent to look like this:

              Parent::gSelectedGrandChild = SelectedGrandChild::FK

              Then you write a script that you attach to a button (or define the entire portal row as a button) that does this:

              Set Field [Parent::gSelectedGrandChild ; Child::PK ]

              Now a portal to SelectedGrandChild will display the grand children records for any child record you select in the portal by clicking the button in the portal row.

              You can also avoid the extra table occurrence and relationship in FileMaker 11 by basing a portal filter on a Global variable that you update instead of the global field. It takes an extra script step but avoids complicating your relationship graph.

              You'd use
              Set Variable [$$GrandChild ; Value:  Child::PK ]
              Refresh Window [Flush cached join results ]

              and base your portal directly on GrandChild with this as the portal filter:

              $$GrandChild = GrandChild::FK

              In either case, you can use conditional formatting to highlight the selected Child row to tell the user which child record has been selected.

              • 4. Re: Issue with a Portal in Portal database
                mcmartinino

                Dear Phil,

                I would like to know if you could make this a bit more clear. I was trying to achieve something similar to what Andy wanted. Here is my idea:

                1) i want to create records for different TRIPS. Each trip consists of several DAYS. Inside each day of the trip are records related to each DAY, like: TRANSPORT, BAGGAGE, COMMUNICATION, FOOD. Which of course happen different for every new day. 

                Since each trip has many days, and each day has many transports, bags, communication and food records I thought it best to create seperate tables.

                My idea was to make a TRIP-layout. add a DAYS-portal so i can add as many days to each trip with the basic info for each trip and every of the related days.

                Then if I wanted to add to each DAY the many different records for TRANSPORT, BAGGAGE, COMMUNICATION, FOOD, that was supposed to be done by more portals of them inside the DAYS portal. The reason was that I do not want to leave the DAYS portal or in fact the TRIPS layout to add as many TRANSPORT, BAGGAGE, COMMUNICATION, FOOD records to every DAY. But i also do not know how many of the Grand-Child records i need for Each DAY (Child-record).  

                I understand that its not possible to add a portal into another portal, which i thought would have been the easiest way to do this.

                I see your post above, but was wondering if you could make it more clear on how it is supposed to work.

                Maybe this can easily be achieved also in a completely different approach? 

                Thanx,

                Martin

                • 5. Re: Issue with a Portal in Portal database
                  philmodjunk

                  Your situation is definitely more complex than the OP. You also do not indicate whether you are using FileMaker 11 or an earlier version of the software--and thus I don't know if you can use a filtered portal or not.

                  Even though a database text book may tell you to put Transport, Baggage, Communication and Food data in separate tables if the data recorded for each is markedly different for each, it will be easier in FileMaker if you can put all that data in the same table, but use different subsets of the fields defined for each record as necessary for each type of trip detail.

                  If you decide to keep the data in separate tables, you can place a separate detail portal for each such table. To make the layout easier to manage, you can place each such portal inside a different tab of a tab control if you wish.

                  • 6. Re: Issue with a Portal in Portal database
                    mcmartinino

                    Hi Phil,

                    i just kind of saw this post again and even though i fixed the issue i had last time in a simpler way by putting all records in the same table it wasn't satisfying. and surely enough i have come across the same kind of problem again. I think i would like to really understand it better.

                    first of all: i use FileMaker 11 Pro

                    Lets say i have the following situation:

                    [A] "Suppliers" >----< [B] "Check-Points" >----< [C] "Details for checkpoints" (but mostly specific for each supplier) (*inside "" are corresponding Layouts.)

                    So i solved the the many-to-many relation ship between [A] and [B] by using a joint table [AB].

                     

                    Now it looks like this:

                    [A] "Suppliers" ----< [AB] >---- [B] "Check-Points" >----< [C] "Details for checkpoints" (but mostly specific for each supplier)

                    added a portal for [AB] on the "Supplier" - Layout and i can add all kinds of Check-Point items and link to each supplier.

                    But now i would like to add to EACH of the Portal Lines from [AB] a more detailed specification from Table [C]. 

                    I tried adding another portal on "Supplier" - Layout, but as already discussed before that didn't get the proper result.

                    So i tried creating another Joint table lets call it [BC] and a new layout "Lines for Details"

                     

                    New Situation:

                    Now it looks like this:

                    [A] "Suppliers" ----< [AB] >---- [B] "Check-Points" ----< [BC] >---- [C] "Details for checkpoints" (but mostly specific for each supplier)

                     

                    Then i added a button that takes me to the current related record from [AB] to the new "Lines for Details" of [BC] where i can now specify this more.

                     

                    However, this is very confusing for anyone but me and i feel there must be a better way. in fact in your post (from: posted November 16, 2010 by PhilModJunk) i think you did describe just what to do, but i reallydon't understand it. would you be so kind and re-explain it one more time in my example.

                     

                    Thanx.