3 Replies Latest reply on Sep 2, 2010 9:27 AM by philmodjunk

    How do I auto-ignore alerts when reports have no values?

    basilisk2

      Title

      How do I auto-ignore alerts when reports have no values?

      Post

      I've created a report that shows what changes have been made to one of my tables for Today. If anyone else has added data, the report contains content and everything is fine. If it doesn't, then I get unwanted alerts.

      The first one says the Find couldn't find anything (Cancel, Continue or Modify Find?). If I click on Cancel, it shows me all the records for all dates, which I do not want; if I click Continue, the same alert reappears once more but goes away after clicking on "Continue".

      Bearing in mind the report will most days show no data, is there a way to suppress the alerts, or to confine their choices to Continue, or to have them automatically enter Continue for me?

      TIA 

        • 1. Re: How do I auto-ignore alerts when reports have no values?
          philmodjunk

          Use this script step:

          Set Error Capture [On]

          just before Perform Find [ ]

          to suppress the error dialog.

          You should now check for errors in your script using get ( LastError ) so your script can respond appropriately to error conditions.

          • 2. Re: How do I auto-ignore alerts when reports have no values?
            basilisk2

            Thanks for your fast response!

            Well, there aren't any errors in the script, it correctly tells me there have been no entries today.

            If I suppress the alert, how do I still ensure the script runs through the tasks and does not show all the previously entered records? The Find command looks for field <Date> = // *.*.* where the *.*.* is entered by FMP itself. I only entered // in the Find box myself.

            Is there a way to say "If result is zero, continue anyway"?

            • 3. Re: How do I auto-ignore alerts when reports have no values?
              philmodjunk

              No records found is an error and there's an error code returned to Get ( LastError ) that will tell you that. A different error code tells you when your criteria is invalid and so forth. An error code of 0 means no errors. Thus you can use Get ( LastError ) to check the results of your find. You can look up the codes in FileMaker help.

              In addition, with set error capture on, if no records match the criteria, then youCet. a found set of zero records and you can check this with Get ( FoundCount )