2 Replies Latest reply on Sep 8, 2011 4:28 PM by ShelleyM

    perform find using multiple drop down list values

    ShelleyM

      Title

      perform find using multiple drop down list values

      Post

      Good Morning -

      I have a status field on a layout in my database that is a drop down list with many choices...pending, dropped, completed, etc.

      I need to write a script to perform a find based on more than one of these choices.  Is there a way to do this?

      Can this be done using just a button or do I need to design a separate find layout?

      I appreciate any ideas!

       

      Thanks,

      Shelley

        • 1. Re: perform find using multiple drop down list values
          philmodjunk

          You don't a find layout, but you do need a script. You also need to clarify whether the find against these multiple criteria uses "and" logic or "or" logic.

          From the example values, I will assume that you want to find, for example, all records with a status of "pending" or "dropped", not "pending" and "dropped" as that makes no sense given these values.

          Set up your drop down list on a text field with global storage. (I'd use a check box field rather than a drop down as I think this is better inteface design for a value list that permits multiple value selections, but the same script will do the job either way here.)

          Use this script:

          Enter find mode[] //clear the pause check box
          Loop
             Set variable [$I ; $I + 1]
             Exit Loop If [$I > valueCount ( Yourtable::globalStatusvaluelistField ) ]
             Set Field [YourTable::YourStatusField ; getvalue ( Yourtable::globalStatusvaluelistField ; $I ) ]
             If [$I < valueCount ( Yourtable::globalStatusvaluelistField ) ]
                New Record/Request
             End If
          End Loop
          Set Error capture [on]
          Perform Find[]

          This creates separate find requests (the new record/request step does this) for each value selected in the value list so that any records with a status of any one of the selected values is found.

          • 2. Re: perform find using multiple drop down list values
            ShelleyM

            Phil,

            Thank you so much.  I have no experience with scripts, so I'll give it a try.  

             

            Thanks again,

            Shelley