3 Replies Latest reply on Oct 16, 2008 12:46 PM by davidhead

    Multi-criteria find for a single field

    tepsic66

      Title

      Multi-criteria find for a single field

      Post

      Hello - 

       

      Sorry if this is a basic question that the included docs should have answered, but I couldn't find it.  

       

      If I wanted to submit multiple criteria for a single field (for example, in CITY I want to find all results that meet Denver, Phoenix, OR San Francisco), how can I do that via script?  Apparently in Find Mode you can do this through multiple 'requests'.  Any other way to do this in find mode, such as entering this multi-criteria right in the field?

       

      In summary:

      - Multi-criteria seaches for the same field (AND, OR) 

      - Through a script

      - In Find mode

       

      Thanks!

      Mark 

        • 1. Re: Multi-criteria find for a single field
          davidhead
            

          Hi Mark

          There are two ways to install multiple search criteria for a single field in a script:

           

          1. Perform Find with restored find requests

          2. Construct Find requests in the script with new requests and set field

           

          The first one is less script lines but the second is favoured by some developers for the explicit nature of the scripting lines.

           

          To do the first one:

           

          1. Add the script step Perform Find to your script in the desired position

          2. Click the Specify Find Requests option

          3. Click the New button to add a new request

          4. In the next dialog, select the City field and in the Criteria box, type Denver

          5. Click Add and then click OK

          6. Repeat steps 3 - 5 for the other two cities.

          7. You have now created multiple stored requests in the script.

           

          To do the second one:

           

          1. Add the script step Enter Find Mode and uncheck the Pause option

          2. Add the script step Set Field, specify the target field as City and the calculated result as "Denver"

          3. Add the script step New Record/Request

          4. Repeat step 2 for the second city

          5. Add the script step New Record/Request

          6. Repeat step 2 for the third city

          7. Add the script step Perform Find and do not specify find requests

          8. This script sequence will enter find mode, create multiple requests and perform the find. 

           

          Try them both and use whichever one makes most sense to you. 

          • 2. Re: Multi-criteria find for a single field
            tepsic66
              

            Great, thanks!  

             

            When in Find mode looking at a form, is there any way to go to a field and enter multiple criteria right in the field?  ("Denver" or "Phoenix") ... Or do you really have to create multiple requests?

             

            Thanks

            Mark

             

            • 3. Re: Multi-criteria find for a single field
              davidhead
                

              There is no way to do this with a standard Find request in FileMaker Pro.

              It can be done as part of a scripted process but that involves the script adjusting the user input to the standard multiple requests before performing the find.

               

              So do you want to simply store a multiple request find in a script or do you want to present and 'easier' interface to the user for constructing finds?