1 Reply Latest reply on Oct 21, 2010 1:50 PM by philmodjunk

    Find Script help using global

    kilbot

      Title

      Find Script help using global

      Post

      I have a script that I have written to find a prime contractors name using a global. However when I execute the script I get the wrong results. Here's what I have.

      set error captur {on}

      set variable{$prime; value:evaluation::g_prime_name}

      enter find mode

      set field {evaluation::prime_contractor_name; $prime}

      perform find

      go to layout {original layout}

      if {get(foundcount)=0}

      show custom dialog

      end if

      Thanks

        • 1. Re: Find Script help using global
          philmodjunk

          You might try removing/disabling the set error capture step and check to see what error message--if any you are getting.

          IF g_prime_name is a global field, you don't also need to use the $prime variable. you can simply use:

          enter find mode[]
          Set Field [Evaluation::prine_contractor_name; evaluation::g_prime_name]
          Perform Find []

          That won't explain why it's not working. It's just simpler code.

          Other things you can check:

          1. In layout set up of the layout you have up when this script runs, you should see "evaluation" without the quotes in the Show Records From box.
          2. Neither Enter Find Mode nor Perform Find should have [Restore] after them. (Enter Find Mode could, but it's better to use set field as this makes it easier to tell what criteria are being specified in the find.)