4 Replies Latest reply on Jul 15, 2009 12:00 PM by demberfilem

    Find Script

    demberfilem

      Title

      Find Script

      Post

      Is there a way to create a script that finds records which: 1. Match certain criteria, and 2. Do not match some other criteria? Specifically, I'm trying to find records which are jobs performed this year, but are not a type of job labeled "mini session".

        • 1. Re: Find Script
          etripoli
             If you can perform the find in 'Find Mode', you can create the script to do the same, and even more.  Do your find in 'Find Mode' first, then create a script containing the 'Perform Find' command, check the 'Specify find requests' box, and it will automatically fill in the requests from your last find.
          • 2. Re: Find Script
            LaRetta_1
              

            " but are not a type of job labeled "mini session".

             

            This would be a second find request and you would OMIT.

            • 3. Re: Find Script
              TSGal

              demberfilem:

               

              Thank you for your post.

               

              The replies from "etripoli" and "LaRetta" are correct (Thank you!).  Let me provide a little more detail.

               

              Assuming the jobs performed this year are put into a Date field "PERFORMED DATE", and the type of job is entered into a field "TYPE JOB", one possible script would be:

               

              Set Error Capture [On]

              Enter Find Mode []

              Set Field [ PERFORMED DATE ; Year ( Get (CurrentDate) ) ]

              New Record/Request

              Set Field [ TYPE JOB ; "mini session" ]

              Omit Record

              Perform Find []

              If [ Get ( RecordCount ) = 0 ]

                 Show Custom Dialog [ "No Records" ; "No Records Found" ]

              End If

               

              -------

               

              Explanation: Error capture is turned on.  This comes in handy when you search for records and no records are found, you can suppress the alert.  We enter Find Mode, put the current year into the PERFORMED DATE field, add a new request, enter "mini session" into TYPE JOB and set it to omit those records.  We then perform the Find.  Now, if the record count is zero (no records found), we can display a message that no records were found.  At this point, you can Show All Records or just exit the script.

               

              Please let me know if you need clarification for any of the above steps.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Find Script
                demberfilem
                   Thanks. Worked like a charm.