1 Reply Latest reply on Sep 17, 2014 9:14 AM by philmodjunk

    Problems with script for repeating a search within a found set

    ShaneB

      Title

      Problems with script for repeating a search within a found set

      Post

      This is the script I use for searching within a found set of records, providing a custom error message if nothing is found, and allowing the user to run a new search or go back to the list of records.

      There are two problems I am running into: 

      1) If the user hits cancel, it does not return them to the previously displayed list of Found Records, but runs the script that returns them to a list of all the "observation" records, which are just records with a particular flag.

      2) If the user hits "OK" to run a new search, the script is actually then running the new search from the found set of records from the previous search, which is likely empty.

      So basically this script doesn't work very well. What I would like to be able to do is for a user to be able to run a new search from the original list of found records they ran the search from, or to go back to the list of found records they ran the search from. However, I am not sure if there is any way to save a users state, or list of found records, in any way, to allow the user to easily view the records they were just looking at. 

      Any help would be appreciated.

        • 1. Re: Problems with script for repeating a search within a found set
          philmodjunk

          I'd be inclined to use a different approach. As you've found, entering find mode and pausing for the user to enter search criteria can be problematic.

          I'd open a dialog or popover with a set of global fields for specifying find criteria. This avoids pausing in find mode, you can check the values of the global  fields to be sure that some criteria was specified and you can use the criteria in the global fields all over again to recreate a found set if necessary.

          There are also several approaches that (in terms of function) "save" the found set--either by saving a list of all the primary key values or by replicating the found set in a hidden window or second layout based on a different occurrence of the same table that might be used to return the user to the previous found set.

          For examples of scripted finds that work from criteria entered into global fields while in Browse mode, see: Scripted Find Examples

          Caulkins Consulting, Home of Adventures In FileMaking