1 Reply Latest reply on Nov 4, 2011 9:20 AM by philmodjunk

    Performing a find with Set Field

    MatthewAdams

      Title

      Performing a find with Set Field

      Post

      Hello,

      I have a table that includes a Name Field, anyone can help me with hpow a script would look like that could perform a find for me using

      Set Field

      Perform Find

       

      ???

      Thanks in advance

        • 1. Re: Performing a find with Set Field
          philmodjunk

          Set Field must enter criteria that you have entered somewhere else or it's a constant value and the find searches with the same criteria every time. I'll assume you entered a name into a text field with global storage and then want to use a script to find all records with that name entered into your name field in your table.

          Enter Find Mode[]
          Set Field [YourTable::Name ; Yourtable::GlobalNameField]
          Set Error Capture [on]
          Perform Find[]

          This will only work as written if the data is stored in a field with global storage specified in Field Options.

          Variations of this method can copy the data from a non-global field to a variable, then set field copies the data from the variable instead of the global field.

          Set Error capture[on] keeps a dialog box from interrupting your script if no records are found. Some developers prefer to use Get ( LastError ) to check for an error code after performing the find to check to see if any records where found, no criteria was specified, etc so as to present the user with a message telling them why the script didn't find any records.