2 Replies Latest reply on Jun 4, 2009 11:42 AM by philmodjunk

    Perform Find Question

    DSM

      Title

      Perform Find Question

      Post

      Hi,

       

      I am running a script that includes a "Perform Find" command. I have three criteria that I need to search for.

      First it looks at record Id numbers > 100000.

      Next it looks at login types = "Login"

      Third I need to to look for a date range that the user can specify.

       

      The third piece is the problem. I can manually put a date range into the Perform Find and it will work, but I can not seem to find a way to allow a user to manipulate the date range criteria. I have tried both global fields and variables. When I enter this data, the find seems to look at it as a text entry rather than a Field name or Variable name.

       

      Is there any way to get this find to work, or perhaps another way that I could perform this find?

       

      Thanks for all the help. 

        • 1. Re: Perform Find Question
          mrvodka
            

          Two global date field for start and end.

           

          Then the script goes

           

          Enter Find Mode []

          Set Field [ RecordID; ">" & 100000 ]

          Set Field [ Login types; "Login" ]

          Set Field [ YourDate; gDateStart & "..." & gDateEnd ]

          Perform Find []

           

           

          • 2. Re: Perform Find Question
            philmodjunk
              

            I use two global date fields. That way I can use filemaker's built in format checking to make sure the user enters a valid date in each field.

             

            Then my script, in find mode, uses:

             

            Set Field [table::dateField; GlobalDate1 & "..." & GlobalDate2]

             

            To convert the user's dates into a date range find criteria.

             

            I usually make things a bit more sophisticated:

             

            Set Field[table::dateField; If(isempty(globaldate2); Globaldate1; GlobalDate1 & "..." & GlobalDate2]

             

            That way, users can specify a single date by just leaving the second field blank.