3 Replies Latest reply on Dec 22, 2011 9:23 AM by theturk15

    Button script to perform a new Find

    theturk15

      I have a small dbase of about 200 records. On a Form, I enter the search string and have scripted a button to perform the Find. It might display, for example, 50 records, but the results are not what I wanted. Time to start over and do a new Find using a different search string on the original 200 records by clicking a "New Search" button on the display form to start over. Every script I've attempted uisng the ScriptMaker ends up either constraining or extending the previous search. All I want to do is start over searching the original 200 records. This can be that hard.

        • 1. Re: Button script to perform a new Find
          BruceHerbach

          Hi

           

          To start over you can have the script show all records.  This should show all 200 records.

           

          You can add a button to the layout that puts you in find mode,  this will let you enter search criteria and then click a perform find button which should search just for the criteria you are looking for.  A standard find will look at all records.

           

          Constrain found set will start with the existing found set and eliminate any records that don't meet the new criteria.

          Extend found set will keep the current found set and add any records that meet the new criteria.

           

          Hope this helps

          Bruce Herbach

          • 2. Re: Button script to perform a new Find
            RayCologon

            theturk15 wrote:

             

            I have a small dbase of about 200 records. On a Form, I enter the search string and have scripted a button to perform the Find. It might display, for example, 50 records, but the results are not what I wanted. Time to start over and do a new Find using a different search string on the original 200 records by clicking a "New Search" button on the display form to start over. Every script I've attempted uisng the ScriptMaker ends up either constraining or extending the previous search. All I want to do is start over searching the original 200 records. This can be that hard.

             

            Hi theturk15,

             

            No, it should not be hard at all.

             

            FileMaker provides three separate script commands - Perform Find[ ] to apply the find to the total/original record set, Constrain Found Set[ ] to act only on the current found set, and Extend Found Set[ ] to act on the records not included in the current found set and add them to the current found set. They're showmn in the Found Sets group of script commands in the Edit Script window:

             

            FindScriptSteps.png

             

            That being the case, starting from scratch is not too difficult, you just have to choose the Perform Find[ ] command. However, you should be aware that the Perform Find[ ] command has the capability to save current find criteria and restore them, and I am guessing that that is what is occurring in your case. If that's the problem, then you simply need to select the Perform Find[ ] command in your script and uncheck the "Specify find requests" checkbox that appears in the Script Step Options pane at the lower right of the Script Editor window:

             

            SpecifyFindRequests.png

             

            If the above suggestions don't help, then I suggest you post an image (or a transcription) of your script so that we can get further insight into what the issue might be.

             

            Regards,

            Ray

            ------------------------------------------------

            R J Cologon, Ph.D.

            FileMaker Certified Developer

            Author, FileMaker Pro 10 Bible

            NightWing Enterprises, Melbourne, Australia

            http://www.nightwingenterprises.com

            ------------------------------------------------

            • 3. Re: Button script to perform a new Find
              theturk15

              both replies were very helpful. thanks for the guidance.