10 Replies Latest reply on Oct 2, 2013 6:25 AM by ScottNalder

    How to "find matching records" from a portal row, without having to use Quick Menu

    ScottNalder

      Title

      How to "find matching records" from a portal row, without having to use Quick Menu

      Post

           Dear Forum

           If I right click each row in a portal, and click "find matching records" from the Quick Menu. I get a different (and correct) set of records for each portal row. This is end result I want. I now wish to streamline this, so that the user need only click on any of the portal rows to get the same end result (and not to have to go through the Quick Menu).  Problem is that I dont know how to "script" the Button Setup on the row in the Portal (being a newbie). The closest I got was Button Setup - Find Matching Records - Specify target field (then specifying a field in what I think is the right table).

           Problem is when I then run it in Browse mode, no matter which portal row I click, it only returns the (correct) set of records for the first portal row, and not any of the others. When I click on any of the other rows, it only returns the set of records for the first portal row.  If I then kill the button setup and revert back to rightclicking on a row in the portal and selecting "find matching records", all is well again.  Is there something I am missing? Any help would be appreciated.

           Regards

           Scott

            

        • 1. Re: How to "find matching records" from a portal row, without having to use Quick Menu
          philmodjunk

               Is there a commit records step in the script? (There should not be.)

               What you describe is typical of a script where the focus on the clicked portal row is lost before it can be used to find the matching records.

          • 2. Re: How to "find matching records" from a portal row, without having to use Quick Menu
            ScottNalder

                  

                 Dear PhilModJunk

                 Thanks for taking an interest in my problem.

                 What I don’t possess at the moment are the skills to “script” this behaviour so that if an end user simply clicks (not right clicks) on, a portal row, it will then do the same as if the end user right clicked on the portal row and selected "Find Matching Records" in the quick menu.

                 Is there an easy script I should be using, and if so, how can I do this – using Button Setup? Assigning a script? I have not assigned a script yet in my (brief) acquaintence with FileMaker Pro. Is there a "script trigger" that I also need to be aware of?

                 Thanks for any help

                 Regards Scott

            • 3. Re: How to "find matching records" from a portal row, without having to use Quick Menu
              SteveMartino

                   Scott, when you right click in a portal row, to get the "Find Matching Records", it's because you right clicked a field.  If you just right click a blank spot in the row you only get "Copy".

                   If it's a 1 row, 1 field portal, its easy to make a button.  If it's multiple field portal, the field you make as your button (or script trigger) is the field you want to get the related records from right?  In other words, say there's a portal row with date, amount, total.  If you right click date, and select "find matching records...you get all records in that same table as the portal (not just that customer) that are from the same date.  If you right click amount, you get all matching records from the table that match that amount (once again from all customers).

                   So to best answer your question, do you want the user to click a field in the portal and find all matching records of all the customers from that table (as defined by the portal)?  Or do you want clicking a button on a portal row to bring you to that related record only, or all records related to that customer?

                   So provide the answer to one of the 3 questions above, and someone can easily help you with the proper script.

              • 4. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                philmodjunk

                     I think Steve has put his finger on the problem. Your button needs to be inside the portal row so that the mouseclick on the button both selects a specific portal row and performs the assigned Find Matching Records script step.

                     As a test, I formatted a field in a portal as a button to perfrom that step and it worked correctly.

                     And keep in mind that this finds matching records in the Layout's table, not the portal's. If you do a find matching on a portal field that has "Apple" in the field, you are finding all records in the layout table that are linked to at least one record in the portal's table that has "Apple" in that field.

                • 5. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                  ScottNalder

                       Dear Steve

                       Thanks for your interest in my problem. To use your examples I want the user to click a field (keywords) in the portal and find all matching records of all the customers (casenotes) from that table (as defined by the portal).

                       At the moment, I have no scripting knowledge, and am using the building blocks supplied by the Button Setup menu. I am converting the field (which is inside the portal) to a button, using the Button Setup. I attach a screenshot to show what I am doing. Upon doing all of this, the problem I am experiencing is that if the end user clicks on any of the "keywords" in the portal, the record set is returning only those casenotes that have the  keyword in the first portal row, not the keyword in the portal row / button that was clicked.

                       Regards

                       Scott

                        

                        

                        

                  • 6. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                    philmodjunk

                         Looks like you are specifying the wrong field. Specify keyword_display name instead of keyword_id and see what happens.

                         And something is odd here as this field should appear in your specify fields dialog and does not. Is it from some other table than casenote_keyword?

                         What table is it from and how is it related to casenote_Keyword?

                    • 7. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                      ScottNalder

                           Dear PhilModJunk

                           Thanks for your help. I have specified a different (hopefully correct) field. But I am still having the same issue. Could I interest you in downloading a trimmed down version of my file which shows the problem. It is an 800 kb file from my dropbox.

                           https://dl.dropboxusercontent.com/u/57214188/casenotes.fmp12

                           When you open it up, it will be on the first casenote record (see attached screenshot). I find that if I convert the portal field to a button (which I have), if you click on the second portal row "representative government", it will return the set of records that have the first portal row ( "electoral law (all)" ) as a keyword. If I turn off the button, and instead right click on "representative government" and select "Find Matching Records" from the menu, I get the behaviour that I want, that is to return the set of records that have "representative government" as a keyword.

                           I just cant replicate this behaviour in a button. Again, thanks for your interest.

                           Regads

                           Scott

                      • 8. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                        philmodjunk

                             On the other hand, you could have just answered the question:

                             

                                  What table is it (keyword_displayname) from and how is it related to casenote_Keyword?

                             As I had noted earlier, this field does not come from the same table as that of the portal's.

                             Opening the file and looking shows that you have a many to many relationship with a portal to the join table and this field comes from a different table also linked to the join table. Then you have changed the portal to be from this other table instead of the Join table as shown in your screen shot.

                             Final analysis:

                             I think you've found a bug in the software that should be reported in Report an Issue. What's weird is that even using a join table based portal and setting up an id field from the join table fails. It may be that my test works as I was using a file and layout converted from FileMaker 11 to FileMaker 12.

                             I did come up with a work around by setting up the field/button to perform this script:

                             Set Variable [$ID ; value: casenote_keyword::keyword_id ]
                             Enter Find mode []
                             Set Field [ casenote_keyword::keyword_id ; $ID ]
                             Perform Find []

                        • 10. Re: How to "find matching records" from a portal row, without having to use Quick Menu
                          ScottNalder

                               Dear PhilModJunk

                               Thanks for all your help. Script works great.

                               Regards

                               Scott