4 Replies Latest reply on Nov 14, 2015 11:21 AM by beverly

    Scripting a find

    MichaelShearer

      I am trying to script a find using the data in a field to find records.

      Here is what I want to do:

      I select a losing team which goes into the losing team field. I then want the script to find all records containing that team in a certain field.

      I did this before but can't remember how.

      Thx for your help

      Mike

        • 1. Re: Scripting a find
          thurmes

          Probably the easiest way is use Find Matching Records [Replace ; Table::Losing Team]; then attach that script to an OnObjectSave trigger.

          • 2. Re: Scripting a find
            beverly

            good answer by thurmes. However, if the value is in one field and must be found in another, I've used a script something like this:

             

            Set Variable ( $myfield ; <<whatever field you need to select>> )

            Enter Find Mode

            Set Field ( NewField  $myfield )

            Perform Find

             

            You are pushing the value in that field in that records to a variable, then you can find based on the variable in any field you wish. You can even go to another layout and/or another table!

             

            HTH,

            beverly

            • 3. Re: Scripting a find
              MichaelShearer

              Hi Beverly

              I'm trying yours first. But I get "provided criteria not valid".

              It appears there is something that I'm missing in the Perform Find [ ].

              I will run the script using a button.

              There are 11 fields numbered 20-10. If a pick is incorrect it scores points 20-10 depending on which field the pick is in. The overall score is like golf.

               

              The two fields I'm using are field "20" and "Loser1". The variable is Loser. When the script is done checking field "20" It then goes to field "19" etc...

              Then after it finds the "Loser" it will put the score into another field which then is added to the other score fields for a total. I have this part figured out but not the "find" part.

               

              Thx

              Mike

              • 4. Re: Scripting a find
                beverly

                you aren't just finding, are you?

                It sounds like you need to do some other variable work (setting) between finds.

                 

                Write it out manually how you need to do that. Make sure you include all the steps. The we can help you script the steps!!

                 

                1. go to field ....

                2. get value and stick in variable named ''...

                3. ???

                ....

                 

                beverly