1 Reply Latest reply on Jul 21, 2015 8:57 AM by SteveMartino

    Can't seem to get Perform Find to work

    AntonioRivera

      Title

      Can't seem to get Perform Find to work

      Post

      I'm relatively new to Filemaker (v.14) and still learning a lot. I've written a script to perform a find for me for all records with a SUB_ID > 0. I've written the following script - which doesn't work by the way.

      ----- start of script

      Enter Find Mode [ Restore ] <-- I've specified a Find Request inside for SUB_ID with criteria > 0.

      If [ Get (FoundCount) > 0 ]

         Enter Browse Mode [ ]

         Go to Layout [ "Report EOD-X Report" (Orders) ]

         Sort Records [ Restore; No Dialog ]

      Else

         Go to Layout ["Main Menu" (Orders) ]

         Show Custom Dialog [ "Information"; "Found no records to report." ]

      End if

      Enter Browse Mode [ ]

      Show All Records

      ----- end of script

      When I run the script I still get unwanted records where the SUB_ID isn't > 0. But when I do a PERFORM FIND from Filemaker and manually enter "> 0" in the SUB_ID field. I get the right output. What am I doing wrong?

      Thank you in advance.

       

      Antonio

       

        • 1. Re: Can't seem to get Perform Find to work
          SteveMartino

          Take out the Enter Browse Mode script steps, none of them are needed.

          First of all, is SUB_ID the primary key?  If so, then it should find all records, if its something else....

          The first step should be:

          Set Error Capture [On] //to hide standard message if no records are found

          Enter Find Mode [ ] //uncheck pause

          Set Field [SUB_ID; ">0"

          Perform Find [ ]//make sure you open up this dialog and delete any leftover find criteria

          ---Do the rest of your script steps, taking out all Enter Browse Mode steps.

          --Take out the last Show All Records.  Despite what happens anywhere in the script, you are going to end up showing all records, defeating the find. Move up Show All Records and put it underneath your Show Custom Dialog in the Else section

          If you set error capture on, and perform a find, you always return to Browse Mode, whether you find records or not