3 Replies Latest reply on Jan 1, 2012 6:49 AM by Sorbsbuster

    "No records match this find criteria"

    ben_mcferren

      Title

      "No records match this find criteria"

      Post

      I am trying to stop the script if variable search results come up as "No records match this find criteria"

      Can someone point me in the right direction?

        • 1. Re: "No records match this find criteria"
          LaRetta_1

          You need to turn error capture on and then handle the results of no records found yourself.  It might look something like this:

           

          Enter Find Mode [ pause ]

          #  User enters criteria and hits return

          Set Error Capture [ On ]

          Perform Find [ ]

          If [ Get ( LastError ) = 401 ]

          #  No records were found

          Show Custom Dialog [ "No records found.]

          ... do whatever if no records found

          Else

          ... do whatever if records are found

          End If

          • 2. Re: "No records match this find criteria"
            kevork

            Laretta,

            I tried to do this but could not get "Get(Last error) = 401" into the calculation of If. There is no Get(Last error) function and typing it in free text brings up an error message. How do you do it?

            I want to change the grammatically incorrect 
            "No records match this find criteria" to 
            "No records match this find criterion" or "… these find criteria".

            I would not want my customers to think that the grammatical mistake was mine :-)

            Kevastan

            • 3. Re: "No records match this find criteria"
              Sorbsbuster

              There is no space between 'Last' and 'Error' - it is Get ( LastError ).  You can see other 'Get' functions if you change the pop-up at the top right of the calculation dialogue to show 'Get Functions'.

              You could also use Get ( FoundCount ) = 0 in this case.

              I think I would show a dialogue that just said "There are no matching records' or something else universal, as I think checking how many criteria the user entered would be disproportionately difficult.