5 Replies Latest reply on Jul 14, 2014 1:41 PM by nihmbrisby

    Perform find/Specify Requests vs Enter find mode/set field

    nihmbrisby

      Title

      Perform find/Specify Requests vs Enter find mode/set field

      Post

           I'm starting to implement search functionality in my database.  Just looking through the manual and list of scripts, I would have assumed perform find with specify requests to be the standard way of specifying find with one or more requests.  But most explanations I see use 'enter find mode' followed by set field and new request.

           Is there a reason the latter method seems to be the standard one?

        • 1. Re: Perform find/Specify Requests vs Enter find mode/set field
          TKnTexas

               It is the older method that has been around the longest.  The other is newer FMPro features.  Use what works.

          • 2. Re: Perform find/Specify Requests vs Enter find mode/set field
            BruceRobertson

                 Enter find mode set field is almost always the preferred method, especially if you (or multiple developers) need to read the script and immediately understand what it is doing.

            • 3. Re: Perform find/Specify Requests vs Enter find mode/set field
              nihmbrisby

                   Thanks TKnTexas and Bruce.

                   Bruce- you say 'especially' if others need to read the script, which makes sense to me.  But does that mean there are other important reasons to prefer the enter find mode?  Could you point me to any discussions on the subject?  Thanks.

              • 4. Re: Perform find/Specify Requests vs Enter find mode/set field
                philmodjunk

                     Three advantages to the "Set field" method: (the other method is actually the original method--but with newer features that allow access to the stored find requests added at a later date.)

                     1) as stated, you can see all the criteria used without needing to open an additional window to do so

                     2) Set field can evaluate a calculation in order to produce the needed search criterion. example "YourTable::gDate1 & "...& and YourTable::gDate2

                     3) Set field is often used in conjunction with global fields where the user enters/select find criteria while in Browse mode, then the script takes relatively simple data such as dates selected from popup calendars in two separate fields and constructs a much more sophisticated criterion such as the above date range example. While this can be done by using Set Variable to assign the resulting search text to a variable and then referencing a variable in the stored find criteria, the set field step does this in one step rather than two.

                     Believe it or not, the original way to script a find was to manually perform the find and then specify Perform Find--which stored and used the last specified set of criteria from your manual find, in your script to perform it the next time. If you later needed to have your script use different criteria, you manually performed a new find, re-opened the script in the editor and told FileMaker to update the find with the last used find criteria in order to apply the update...

                     We've come a long way since then!