5 Replies Latest reply on Sep 28, 2012 9:03 AM by LaRetta_1

    More Rookie frustration

    jb362

      Title

      More Rookie frustration

      Post

           I want to find if there any records that fall within a specified date range.

           Prior to the Perform Find step I set $$StartDate = Get(CurrentDate) and $$EndDate = $$StartDate + 30

           The Find Request Criteria is set to Tasks::DropDeadDate: [$$StartDate…$$EndDate]

           I’m receiving FMP error code 500 - Date value does not meet validation entry options

           So then I composed a Custom Dialog and added it before the Perform Find step.

           The dialog reports the values for $$StartDate and $$EndDate to be 9/28/2012 and 10/28/2012 respectively.

           What am I missing? 

        • 1. Re: More Rookie frustration
          davidanders

               The Find Request Criteria should be set to Tasks::DropDeadDate: [$$StartDate & "…" & $$EndDate]

          • 2. Re: More Rookie frustration
            jb362

                 Thanks.

                 Makes sense when you know the answer.

                 I haven't thought through the reasoning as to why but when constructing the criteria and the user clicks the elipses shouln't FMP put up & "..." & instead of just the elipses?

                  

                  

            • 3. Re: More Rookie frustration
              jb362

                   David:

                   When I modified the Find Request per your suggestion I am still receiving the same error message.

                   Now what?

              • 4. Re: More Rookie frustration
                philmodjunk

                     I recommend that you write your script like this:

                     Enter Find mode [] ---> clear the pause check box, no find criteria specified in this step
                     Set Field [YourTable::YourdateField ; $$StartDate & "…" & $$EndDate ]
                     Set Error Capture [on] ----> keeps "no records found" dialog from interrupting your script
                     Perform Find [] ---> no find criteria specified here

                     This keeps all your search criteria "out in the open" which makes reviewing your script to check what criteria is used easier as you don't have to double click a step to open up the extra dialog just to see what criteria was used and the Specify Criteria dialog can evaluate expressions anyway--which is why this has to be implemented with the set field step.

                • 5. Re: More Rookie frustration
                  LaRetta_1

                       Nothing wrong with using restore ... I use them all the time. Just set the entire variable first and then put only the variable in the stored find request - No need to use global variables either; if you use them remember to clear their values when done ... global variables are persistent until file closes.  So you can do away with it all and use simpler steps which might look like this:

                       Set Variable [ $range ; Get ( CurrentDate ) & ".." & Get ( CurrentDate )  + 30

                       Set Error Capture [ on ]

                       Perform Find [ restore ; $range ]