3 Replies Latest reply on Jun 22, 2013 7:20 AM by philmodjunk

    Creating Find Script Button

    MartinKim

      Title

      Creating Find Script Button

      Post

            I tried both methods from previous forums but it is not working for me; nothing happens when I click the button. Any ideas?

      1.png

        • 1. Re: Creating Find Script Button
          schamblee

               Here is a post about finds.

          Scripted Find Examples

          • 2. Re: Creating Find Script Button
            GuyStevens

                 Hey Martin.

                 Let's say you have a contacts table with contact information. And for instance you want to search for all contacts from a certain state.

                 Then first of all you will need a field where you can enter the state you want to search for.

                 Let's call that "g_search_State" It should be a text field set to global storage in the field settings.

                 Then you can create the following script: (that you can attach to a button)

                 Enter Find Mode [Uncheck Pause]
                 Set Field [ Contacts::State ; g_Search_State ]
                 Set Error Capture [On]
                 Perform Find
                 Sort Records (if needed)

                 The Set Field step is a tricky one. Because it requires two values. First of all you need to determine in which field you are going to set a value. And then secondly you need to determine the value that needs to be set. In this case that's the value that's in the g_Search_State field.

                 Then if you want you can add an If statement that checks if the g_Search_State field has a value in it or not. etc.

                 Let us know if you run into any problems.

            • 3. Re: Creating Find Script Button
              philmodjunk

                   In your scripts you have the setp Perform Find/Replace where you should have the step Perform Find. See the link S Chamblee posted for more on how to script it as there are other details missing from both scripts.