2 Replies Latest reply on Mar 19, 2009 9:31 AM by philmodjunk

    Remember search values from a previous search



      Remember search values from a previous search


      I have a simple script which will make a search post where you are supposed to fill in some values in the search fields. When you put in the relevant values then the search will be executed. Ok, when I run this script again, all the search fields are empty and you have to fill in new values in the search fields in order to make a new search.


      How can I make the script remember some values from the previous search, so you don't need to fill them in every time? 


        • 1. Re: Remember search values from a previous search

          Hi thaedra and welcome to the forum.


          Depending on how your scripts work one thing to try would be to use the 'Modify Last Find' script step to take the user into Find Mode with there previous find criteria, however this is limited to the user and the current session.


          Other script steps to look at are 'Constrain Found Set' which allows the user to create a brand new find criteria but limit the search to the found set they were in before entering Find Mode. and the 'Extend Found Set' which works the same as above but searches outside the found set and adds to it.


          Let me know if any of these are of use or if anything needs further explanation. 

          • 2. Re: Remember search values from a previous search

            If the criteria is always the same, you can use the specify find requests option. If you want certain criteria always set with other criteria supplied by the user, Use "Enter Find Mode" and use the specify option to record any criteria that's always the same. Then either stop or pause the script so the user can finish specifying the information. If you don't need the user to enter any criteria, just use Perform Find with the specify option.


            If the criteria you want to retain are from the user's previous find request, you can try Orlando's suggestions or you could try the following:


            Set up a layout with a global field for each field the user will use in setting up their search. Give it a button to trigger a script and write your script to:


            1. switch back to their report/data entry layout.
            2. enter find mode
            3. Use set field to copy the data from each global field to it's matching field
            4. Perform the find.


            If the user wants to refine their latest search, take them back to the search layout and they'll see their criteria still there from their last search.


            Note: If your database is hosted over a network, each user will see just their data in the globals fields and the data will be lost when they close their instance of the database.