2 Replies Latest reply on Oct 16, 2013 12:07 PM by MattDeBono

    Jump to record under found set meeting field criteria



      Jump to record under found set meeting field criteria


           Hi there, I am new to filemaker and have come to a stand still creating a script.

           Example: Asset Defect Database

           This database contains defects related to structures under an asset

           I have created a script that brings back matching records based on an asset name in a different layout using

           Find Matching Records [Replace;Patrol Database_Defect::Line Name]

           Constrain Found Set [Restore]

           Go to Layout ["Patrol Sheet" (Patrol Database_Defect)]

           Sort Recrds by Field [Ascending; Patrol Database_Defect::Structure Order]

           I would then like to add a button or drop down list(with script trigger) to go to the first record that contains the relevant structure number entered in the global field under the already found set of records without filtering any more, I hope that makes sense.

           I have setup a global field for the structure number but can only get it to bring back records with the structure number selected spread over all of the assets.

           I feel I am overthinking it a bit but any help is much appreciated in advance.

        • 1. Re: Jump to record under found set meeting field criteria

               Is the record that you are trying to isolate a record that is in the current found set of records produced by your script?

               There are several possible methods that you can use that all produce similar (but not identical) results:

               1) You can return to find mode and constrain the found set again specifying the value from the global field as criteria. This reduces your found set to just the matching records. While in Find Mode, set field can copy data from the global field into a specified field in order to set up the needed find criteria before constraining the found set.

               See this thread for examples of using set field with global fields in that manner: Scripted Find Examples

               2) A looping script can loop through the found set of records and stop on the first one that matches the specified value in the global field. This leaves your found set unchanged but now the specified record is the current record in that found set.

               3) A relationship can be used with Go To Related records to either pull up a found set of just the specified record(s) or the same found set as your current script but with the record matching this global value selected as the current record.


          • 2. Re: Jump to record under found set meeting field criteria

                 Thankyou for your answer as the number of records is minimal I used a looping script as below;

                 Go to Record/Request/Page [First]


                 Exit Loop If [TableName::FieldName = TableName::GlobalFieldName]

                 Go to Record/Request/Page [Next; Exit after last]

                 End Loop

                 This script works perfectly for what I needed I much appreciate the help.