1 2 Previous Next 17 Replies Latest reply on Jan 13, 2012 2:11 PM by LWayne_1

    Selection one record from Portal



      Selection one record from Portal


      Hi -

      I have a portal on a layout that can contain many records.  I would like to select one record in the portal and have it display only that one record (the table has more fields than the portal and a vertical view works better than the horizonial one that's on the portal) on the same layout (or at least call a window that will display the selected record).  Can someone point me in the right direction to accomplish this?  I am relatively new to FileMaker and would like to use the best way.




        • 1. Re: Selection one record from Portal

          What relationship do you have for your portal? (Always tell us that when you have a portal that's part of your issue.)

          Usually such a portal uses a self join relationship with the X operator. Is this the case in your database?

          LayoutTableOccurrence::anyfield X PortalTableOccurrence::anyfield

          If so, clicking a button in the portal row (which can be all the fields in the row set up as a single button with button setup...), can use Go to Related Records to switch the current record in LayoutTableOccurrence to that which was clicked in the portal. You can also use conditional formatting to highlight the matching portal row thus clicked by changing the fill color of the fields.

          Go To Related Record [From table: PortalTableOccurrence ; Using layout: <CurrentLayout> ]

          • 2. Re: Selection one record from Portal

            Phil -

            I use an = operator versus and X operator, what is the purpose of an X operator?

            • 3. Re: Selection one record from Portal

              The X operator is the cartesian join operator it matches any record in LayoutTableOccurrence to all records in PortalTableOccurrence.

              As long as your portal lists the records you want to see, the Go To Related records method I described should work.

              • 4. Re: Selection one record from Portal

                Phil -

                Thanks.  I will try that and let you know.

                • 5. Re: Selection one record from Portal

                  Phil -

                  I receive this message: "This operation could not be completed because this layout cannot display the result."  Maybe I am trying to do something that is not possible without opening another window?

                  Here is what I am trying to do: Let's say the PortalTableOccurrence has 10 records.  I want to click on one record and have it show the information of that record  on my Layout, however it continues showing the first record only.




                  • 6. Re: Selection one record from Portal

                    Ok, we have a different design structure than I assumed.

                    From your description, I assumed that LayoutTableOccurrence and PortalTableOcurrence referred to the same data source table in a self join. That's the simplest set up for selecting a portal record and seeing the details appear on the rest of the same layout.

                    The error message tells me that you have two different tables linked in the relationship used for your portal. Please describe the design and purpose of your two tables in more detail.

                    • 7. Re: Selection one record from Portal

                      The PortalTableOccurrence is joined with PortalTableOccurrence2.  The join field is RecordNo, so PortalTableOccurrence has 10 record numbers and I was trying to join it wih PortalTableOccurrence2 and then display the results of only one record in a dirfferent part of the layout.

                      • 8. Re: Selection one record from Portal

                        If so, then you shouldn't get the error message that you did.

                        First, let's clear up some terminology: (You may need to just skim this section.)

                        Data Source tables are what you create on the table tab in Manage | Database.

                        Table Occurrences are what you create on the relationships tab. When you define a new table on the tables tab, fileMaker creates a table occurrence box and a new layout with exactly the same name. While the names are the same, these are three different objects. You'll find that the new layout refers to the new table occurrence in Show Records From, found in Layout Setup.

                        Each table occurrence refers to a specific data source table. At the start, each table occurrence refers to the data source table with the same name, but you can add more table occurrences that refer to the same tables and give these added occurrences different names. This is done to make it possible to create more relationships between the same data source tables. To see what data source table is referred to by a given table occurrence, hover the mouse over the upper left corner of the box or double click the box.

                        A "Self Join" is a relationship that uses two occurrences of the same data source table to link that table to itself. If you have a self join relationship, hovering the mouse over either occurrence box's upper left corner should display the same data source table name.

                        In our case, if this is a self join relationship, you should find this on the relationship tab, but with your names used in place of mine:


                        Two boxes, with one data source table.

                        If you open layout setup for your layout, it should list "LayoutTableOccurrence" in "Show Records From". If you open portal setup, it should show "portalTableOccurrence" in "Show Related Records From".

                        Please confirm that this is what you have here before we move forward.

                        • 9. Re: Selection one record from Portal

                          I have to leave for a meeting but will be back to you as soon as I am back, probably 2 hours or so.


                          Thanks for your help.

                          • 10. Re: Selection one record from Portal

                            I have three TO’s (table occurrences).  The Layout_TO is a one record table (Table 1) containing several fields.  One of the fields is related to a field in my Portal_TO.  The Source Table for this TO is (Table 2) and this Table 2 contains several records for each related record in the Layout_TO.  The third TO uses Table 2 as its Source Table and is related to the Layout_TO using the primary key of Record ID and thus the third TO shows only one record.


                            From your information I understood that the TO’s on my Layout must all be from one table, however it was my understanding that you could not have a Portal on a layout unless you had a one to many relationship (Parent to Child). 


                            Let me know if you need further information.



                            • 11. Re: Selection one record from Portal

                              The Layout_TO is a one record table (Table 1) containing several fields.

                              Table 1::Field = Table 2::Field

                              What I thought, this is not the "self join" that I orginally assumed and that will require some change in order to make this work.

                              portals will work with one to one relationships as well as one to many, you'll just see only one record in the portal with a one to one. However, self join relationships can and often are one to many even though there is only one table specified for the TO's on both sides of the relationship.

                              You have two options: Set up the self join so that both layout and portal refer to different occurrences of the same data source table as I originally assumed or do the following:

                              Define a Number Field, gSelectedRecord, in Table 1. Often, this will be a field with global storage specified. Make sure that Table 2 includes a serial number field that uniquely identifies each record in the table. Define this relationship:

                              Table 1::gSelectedRecord = SelectedTable 2::SerialNumberField.

                              On your layout add fields from SelectedTable 2 to your Table 1 layout. Instead of Go To related record, use this script:

                              Set Field [Table 1::gSelectedRecord ; Table 2::SerialNumberField ] (I am using "Table 2" as the name of the occurrence specified for your portal.)
                              Commit Record

                              This should cause the fields on the layout to display the record clicked in the portal. You can also add a conditional format to the fields in the portal to change their fill color if table 1::gSelectedRecord = Table 2::SerialNumberField.

                              • 12. Re: Selection one record from Portal

                                Thanks for all your help.  I will let you know how I come out.

                                • 13. Re: Selection one record from Portal

                                  Check out this Youtube video starting at 3:00 minutes in. Sounds like you are trying to achomplish what I was looking to do. I have a portal that shows unique list of RMAs and I want to be able to select one and get all the details. This worked like a charm for me and it was extermely ease to implement.

                                  http://youtu.be/iYAPPB6P0ZI - This link should work.

                                  Thanks to Mighty Data for posting the video.

                                  • 14. Re: Selection one record from Portal

                                    Phil -

                                    I tried what you suggested and it worked like a charm.  Thanks for all your help.

                                    1 2 Previous Next