1 Reply Latest reply on Jun 1, 2009 11:54 AM by philmodjunk

    FMP 7 Perform Find Script step

    Sendnot

      Title

      FMP 7 Perform Find Script step

      Post

      I have a database where I want users to perform a find with 2 buttons and drop-down value lists. The first button triggers the 'Enter Find Mode' script step; no pause, no specify find requests. The second button triggers the 'Perform Find' script step. The idea is that the user would hit the first button to enter find mode, select the criteria of the find from 2 drop-down values supplied by value lists, then click the button that triggers the 'Perform Find' script step. I've looked for a way to do this by specifying the find request, but I can't see how I would set up or edit a find request to accept what's in the drop-down lists I want to use.

       

      It seems like in FM 6, you could perform the find manually, then the criteria would be there when you went to build the script. I've been looking for a way to get this script running the way I described, but so far the solution is eluding me. Any ideas? 

       

      Thanks in advance! 

        • 1. Re: FMP 7 Perform Find Script step
          philmodjunk
            

          If you were to find records without using a script, would you simply select values from the drop down menus and then click the Perform Find button?

           

          If yes, then your script for your second button would be:

           

          If [Get(WindowMode) = 1 /*make sure db is in find mode */]

            Perform Find []

          End If

           

          If No, then define your drop down fields as global fields and delete your first button. (You won't need it.)

           

          Enter Find Mode[]

          Set Field [table::fieldname1, table::globalfield1]

          Set Field [table::fieldname2, table::globalfield2]

          Set Error Capture [on]

          Perform Find []

          Set Error Capture [off]