7 Replies Latest reply on Nov 2, 2013 11:56 AM by JimBessette

    Can one select records from a portal to update the displayed layout?

    JimBessette

      Title

      Can one select records from a portal to update the displayed layout?

      Post

           I'm trying to display fields from the table a portal contains on a layout that is for a different table.   I want to be able to click on the field in the portal and have it update the fields displayed in the layout.  Here's my scenario:  

           I have a "Tourer" table which contains information on someone taking a tour.  That's the layout I'm using for this also - mainly the Tourer table fields.  On the layout I have a portal, which shows the tours the person has taken (Member Tours).  They get sorted.  I can add tours using the portal and delete them.  I also show fields on this layout that correspond to the Member Tour .

           What I want to do is to be able to click on one of the portal entries (Member Tour Code) and have the fields corresponding to that tour display on this layout.  

           I have a pared down version of the DB if that would help, I just don't know if it's right to post it here or not.

           Thanks for any help,

           Jim 

        • 1. Re: Can one select records from a portal to update the displayed layout?
          philmodjunk

               You appear to have this relationship:

               Tourer---<member Tours

               Tourer::__pkTourerID = Member Tours::_fkTourerID   (though your field names are likely different from mine)

               You can create a new table occurrence of member tours and link it to tourer like this:

               Tourer::_fkSelectedTourID = Member Tour|selected::__pkMemberTourID

               Then you can place fields from Member Tour|selected on your layout and a button in the portal row can perform this script:

               Set Field [Tourer::_fkSelectedTourID ; Member Tour::__pkMemberTourID ]

               to cause those fields to display data from the selected record.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

          • 2. Re: Can one select records from a portal to update the displayed layout?
            JimBessette

                 Phil,

                 That worked well!   The only problem I have now is that I can no longer add records using the portal.  I made sure the relationship allowed adding records, but somehow making the field a button prevents me from adding more tours in the portal.  Any ideas what I did wrong, or how to fix that?

                 Thanks again,

                 Jim

            • 3. Re: Can one select records from a portal to update the displayed layout?
              philmodjunk

                   Don't make the field a button. Put a button in the portal row next to the field.

              • 4. Re: Can one select records from a portal to update the displayed layout?
                JimBessette

                     EXCELLENT.   That worked.

                     THANKS!

                     Jim

                • 5. Re: Can one select records from a portal to update the displayed layout?
                  JimBessette

                       One more question regarding this.   I have my portal rows and created a button; I used an arrow, on the side (for each entry) that when clicked, will update the fields in the rest of the layout.   I also have  WorkingTourCode populated in red when an arrow is clicked, so at a glance the user can see for which Tour the fields are displayed. I created a button from that field that when clicked, will bring me to a Related Record in a different Layout.  This all works really well.  I found a bug though when testing.  If I click the TourCode field in the Portal (not the arrow button next to it), it will highlight it, and it seems to "set" my WorkingTourCode to that tour code - even though the text is not updated, as it is when I click the arrow.   If I then click the WorkingTourCode field (button), it brings up the related record corresponding to the "highlighted" portal field - not the record for what the text is showing.  I'm wondering why just clicking a field in the portal is "setting" my WorkingTourCode field to the value from the portal, hence displaying the incorrect Related Record in the other Layout.

                       I hope I described that well enough.

                       Thanks,

                       Jim

                  • 6. Re: Can one select records from a portal to update the displayed layout?
                    philmodjunk

                         When you use GTRR to go to the portal's table occurrence the record in the portal that has the focus becomes the current record in the found set thus produced on the target layout. Clicking a button does not change the focus so the cursor in the portal row's field sets up that record as the current record in the target layout.

                         But it would appear that the button outside the portal is specifying the wrong related table. Set its script or script step to GTRR to the MemberTour|Selected "Table" instead of MemberTour. (Throughout FileMaker, you'll find drop downs where you are asked to select a table when you are really selecting a table occurrence--a box on the relationship graph instead of a table named as such in Manage | Database | Tables. )

                    • 7. Re: Can one select records from a portal to update the displayed layout?
                      JimBessette

                           Phil, I have to say, you amaze me.   Though the drop down didn't show the "Selected" Table, in the field in the pop up for GTRR I didn't have the "Choose Records from" correct.  I did have the original table, not the "Selected" table.  

                           I really hate to feel like I'm taking advantage of you, but I do feel that way.  Thank you SO much…. again.

                           Jim