1 2 Previous Next 23 Replies Latest reply on Jun 12, 2017 7:04 PM by user25183

    Layout with two level of portal

    user25183

      I have a layout where I want two level of portal.

       

      Once a selection is made in the first portal, the second portal need to populate accordingly.

       

      So far I have the two portals both populate with related records from the main layout table.

      I have try various form of relationships

       

      Table1       Table2      Table3    this show all related records from table 2 and table 3

      pk_t1 ---<  fk_t1 

                        pk_t2 ---< fk_t2

       

       

      Table1      Table2      Table3   this show all related records from table 2 and table 3

      pk_t1 ---<  fk_t1 ---< fk_t1

                        pk_t2 ---< fk_t2

       

      I have try using trigger script to no success

       

      any example available or suggestion

        • 1. Re: Layout with two level of portal
          coherentkris

          think in multiple relationships and think TABLE OCCURENCES instead of tables

          ..

          Relationship 1...

          TO of Table1      TO of Table2      TO of Table3   this show all related records from table 2 and table 3

          pk_t1 ---<  fk_t1

                            pk_t2 ---< fk_t2

           

           

          Relationship 2

          TO of Table1      TO of Table3

          pk_t1 ---< fk_t1

           

          The pseudo ERD you gave us strongly suggests that learning the difference between an ERD and the relationships graph as well as the differences between Tables and TO's would be a good thing.

           

          You should also look into conditional value lists and portal filtering as these techniques may be able get you to a solution.

           

          There are several ways to accomplish "conditional" portals and your choice of methods will indicate the optimal relationship graph design

          • 2. Re: Layout with two level of portal
            planteg

            Hi,

             

            can you tell us more about your tables ? Is table 2 a join table for Table1 and Table2 ?

            • 3. Re: Layout with two level of portal
              siplus

              Let's start by putting ourselves into the user's shoes.

               

              Starting setup:

              A portal with related records and n empty portals at its right - because no choice has been made yet.

               

              Click on an element of the first portal:

              The second portal populates with choices pertaining to the chosen element in the first.

               

              Click on an element of the second portal:

              Everything repeats.

               

              in such cases I have globals in the first table that link to the second, third etc tables.

               

              When I click in the first portal, I set global1 to the value and zero all the other globals.

               

              When I click in the second portal, I set global2 to the value and zero the remaining globals.

               

              Do you see a repeating pattern ? I do.

              • 4. Re: Layout with two level of portal
                user25183

                Thanks for you suggestions, conditional value list and portal filtering .

                Yes I already use Table Occurrences , just didn't,t think it would make a difference in this explanation.

                ERD is ?

                • 5. Re: Layout with two level of portal
                  user25183

                  It is three level, not a join table.

                   

                  like Parent, child and grandchild

                  • 6. Re: Layout with two level of portal
                    user25183

                    If I understand you don't use relationship.

                     

                    you have a filter in each portal that look like   portal2key=global1  then portal3key=global2......?

                    • 7. Re: Layout with two level of portal
                      planteg

                      ERD is an Entity-relationship diagram. This is used in SQL databases like for example MS SQL Server. The look is the same as for relationship diagram but there is a main difference:

                       

                      • the ERD refers to the real tables, and determines relationships irrespective of the way data is manipulated
                      • the Relationship Diagram is used to create the context for a layout, connecting the the Table Occurrences. In fact it's used to create the query used to get the data for a Layout. By itself, id does not dictate anything
                      • 8. Re: Layout with two level of portal
                        siplus

                        no you no undertand.

                         

                        no Filter.

                         

                        Post your database with data and I'll implement the tree traversal.

                        • 9. Re: Layout with two level of portal
                          user25183

                          Thanks

                          I have use ERD long time ago, just didn't understand it in FMP context.

                          I start to understand more and more the TO and Relationship Diagram of FMP,  in the RD the Table Occurence only carry the Table and the link (relationship) connected to that occurence.

                          • 10. Re: Layout with two level of portal
                            philmodjunk

                            Set up these Relationships:

                             

                            Table3Occurrence>-------LayoutTableOccurrence--------<Table2Occurrence

                             

                            LayoutTableOccurrence::__pkLayoutTOID = Table2Occurrence::_fkLayoutTOID

                             

                            LayoutTableOccurrence::_fkSelectedTable2ID - Table3Occurrence::_fkTable2ID

                             

                            Put a button in the portal to Table2Occurrence with this script step:

                             

                            Set Field [ LayoutTableOccurrence::_fkSelectedTable2ID ; Table2Occurrence::_pkTable2ID ]

                             

                            Make the second portal a portal to Table3Occurrence.

                             

                            Click the button in the portal row of Table2Occurrence and the related records will appear in the Table3Occurrence.

                            • 11. Re: Layout with two level of portal
                              user25183

                              Simple database is at

                              2 portal in a layout

                               

                              See down in this conversation a post of the database, I learn of the "advance options"

                              • 12. Re: Layout with two level of portal
                                user25183

                                Hi

                                 

                                I have done what I could understand of your suggestion. With a change I believe needed

                                 

                                Table3Occurrence>-------LayoutTableOccurrence--------<Table2Occurrence

                                 

                                LayoutTableOccurrence::__pkLayoutTOID = Table2Occurrence::_fkLayoutTOID

                                LayoutTableOccurrence::__pkLayoutTOID = Table3Occurrence::_fkLayoutTOID

                                 

                                Put a button in the portal to Table2Occurrence with this script step:

                                Set Field [ LayoutTable3Occurrence::_fkSelectedTable2ID ; Table2Occurrence::_pkTable2ID ]

                                 

                                On open show all related record for both Table2Occurence and Table 3Occurence

                                button does nothing!

                                 

                                PS Thanks didn't know about the advance fonction here.

                                • 13. Re: Layout with two level of portal
                                  piaccounting

                                  philmodjunk and beverly provided answers to Portal subsets which looks very similar to your query. Worth checking out.

                                  Dave

                                  • 14. Re: Layout with two level of portal
                                    philmodjunk

                                    Take another look at my suggested relationships. I put "layoutTableOccurrence" in the middle. You have not done this in your demo file.

                                     

                                    You actually need both sets of relationships, which combine to produce:

                                     

                                    GrandChildren|Selected>-----Parent----<Child---GrandChild

                                     

                                    Your layout would refer to Parent and your two portals would be to Child and GrandChildren|Selected. This last is a second occurrence of GrandChild.

                                    1 2 Previous Next