2 Replies Latest reply on May 22, 2012 11:41 AM by greengk2fi

    Script Asking for Entry of Date Range

    greengk2fi

      I'm coming from Access and finishing a FileMaker DB. I must be missing something basic as I'm building one particular script.

       

      So far the script successfully

      1. opens a window,
      2. goes to the layout,
      3. finds the a set of records

       

      But when I add the step of constraining the result to a date that the user enters at the time of the script, I get an error. I'm simply using ["data entry"] for the date field. Do I need to use a different syntax for data entry on a date field? Any help would be greatly appreciated.

      Screen-Shot-2012-05-22-at-1.36.36-PM.png

        • 1. Re: Script Asking for Entry of Date Range
          Mike_Mitchell

          Hello, greengk2fi.

           

          FileMaker's stored Find requests don't have a parameterized system like what you're trying to use. Rather, you would need to insert a pause in your script to allow the user to enter search criteria, then put a "Go" button that resumes the script with the user's criteria in there.

           

          I find that, in these kinds of situations, it's often best to let the user perform whatever Find he wants to, then use Constrain Found Set to narrow things down after the fact. It tends to produce fewer opportunities for users to hose up the works.   

           

          One option to accomplish this would be to build a screen using global fields that allows the user to put in his search criteria (you reference a date range). Then, build your script to capture the user's entry using variables and insert the results into your Find requests at runtime. That way, you can run whatever validations you need to rather than relying on pausing the script (which is fraught with hazards).

           

          HTH

           

          Mike

          1 of 1 people found this helpful
          • 2. Re: Script Asking for Entry of Date Range
            greengk2fi

            I think all of that makes good sense and perhaps I'll leave that last step for user entry.  Your note about using fields for the search is also good and in fact, I have a portal that filters based on entry in a field that works well.

             

            Having said that, I think I should have been working with quick find rather than find.  I don't get the date error when I approach it with quick find.

             

            Be well,

            Greg