1 Reply Latest reply on Jan 28, 2011 4:18 PM by philmodjunk

    Perform Find Question - dynamically changing criteria field

    DDab

      Title

      Perform Find Question - dynamically changing criteria field

      Post

      Hi

      I am running a script that includes a "perform find" step. I am trying to find a way to tackle a dynamically changing criteria based on user selection. The following example will illustrate the situation:

      Let's say I have a table that contains a field called 'Color'. In the GUI, the user can select the color from a check box field. For example, they could select [Red] or [Red, Green] to search for. Is there a way inside the 'specify found request' window to match a field against a list (ie Red¶Green¶Blue )? To find records that have either Red or Green or Blue in their Color field.

      My current solution is to loop through the list and in each cycle constrain the found set. But that is a very expensive operation. I am looking for a better shortcut

      Cheers,

      D

        • 1. Re: Perform Find Question - dynamically changing criteria field
          philmodjunk

          Make your check box field, gColor, a global text field and format it with your color check boxes. Then this script will do the job:

          Enter Find Mode[]
          Loop
            Set Variable [$I ; Value: $I + 1 ]
            Set Field [ YourTable::Color ; GetValue ( YourTable::gColor ; $I) ]
            Exit Loop If [$I > ValueCount ( YourTable::gColor ) ]
            New Record/Request
          End Loop
          Set Error Capture [on]
          Perform Find []