5 Replies Latest reply on Oct 3, 2013 11:07 AM by philmodjunk

    Find Matching Records Script Step Fails when field is in a portal

    philmodjunk

      Summary

      Find Matching Records Script Step Fails when field is in a portal

      Product

      FileMaker Pro

      Version

      12.04

      Operating system version

      Windows 7

      Description of the issue

      If you right click a field in a portal and select "find matching records", FileMaker finds all parent records with at least one matching portal record. If you set up the field as a button to perform the Find Matching Records script step, FileMaker finds all parent records with at least one portal record that matches the first row in the portal rather than that of the row that was clicked.

      Steps to reproduce the problem

      See: https://dl.dropboxusercontent.com/u/78737945/FindMathingTest2.fmp12
      for a demo file that shows this issue.
      Define two tables and link them in a relationship.
      Enter data in the portal's table such that multiple records appear in the portal for multiple parent records.
      Set up a field in the portal as a button to do the Find Matching Records script step.
      Click the field in any row but the first row and then examine the resulting found set.

      Expected result

      For each record in the found set, at least one portal record should show data that matches that of the portal row that was clicked.

      Actual result

      For each record in the found set, at least one portal record shows data that matches that of the first portal row on the parent record where the portal field was clicked.

      Workaround

      Create a script that sets a variable to the value of the field that is set up as a button and then uses that variable to perform a find. Set up the field to perform this script instead of "find Matching Records".

        • 1. Re: Find Matching Records Script Step Fails when field is in a portal

          PhilModJunk:

               Thank you for the post.

                

               I am able to replicate this behavior and agree this seems inconsistent when compared to similar script steps such as Set Field or Go to Related Record.

                

               As another possible workaround, use this script without a target field specified:

                

               Find Matching Records [Replace]

                

               Use the script trigger OnObjectEnter on the portal's field to trigger the above script and this should return the desired result. 

                

               I forwarded the provided sample file and a report to Testing and Development for additional clarification. 

                

               TSFalcon

               FileMaker, Inc.

          • 2. Re: Find Matching Records Script Step Fails when field is in a portal
            philmodjunk

                 "Seems inconsistent"???? It IS inconsistent. Script steps should match the behavior of their corresponding menu options. This is one of the design features of FileMaker that makes scripting an easier transition for users new to scripting and programming. The user can test what they want by making a series of menu choices and then string the same steps together to make a simple script. Inconsistencies like this sabotage that "easy of use" aspect of the FIleMaker Design.

                 Without a target field specified and the field set up as a button, the script throws an error message indicating that no target field has been specified. Using OnObjectEnter will work, but this requires allowing "edit" access to the field and this might not be desirable in many situations.

            • 3. Re: Find Matching Records Script Step Fails when field is in a portal

              PhilModJunk:

                   Thank you for the reply.

                    

                   Testing and Development was also able to reproduce and confirm the issue. 

                    

                   Testing provided another workaround, allowing the field to be specified as a button:

                    

                   Go to Field [Child::Name]

                   Find Matching Records [Replace]

                    

                   There is no additional information at this time.

                    

                   TSFalcon

                   FileMaker, Inc.

              • 4. Re: Find Matching Records Script Step Fails when field is in a portal
                Fred(CH)

                     Interesting...

                     This is often the workaround that validate the bug quality of a behavior...

                     Bye, Fred

                • 5. Re: Find Matching Records Script Step Fails when field is in a portal
                  philmodjunk

                       An entry in the Known Bugs List has been linked to this thread. Any concerns comments or corrections about the entry in the list should be posted here rather than in the list thread.