4 Replies Latest reply on Jun 10, 2009 11:45 AM by philmodjunk

    Checkbox Searches

    craig5005

      Title

      Checkbox Searches

      Post

      I am using a checkbox to perform a find for example... a user clicks on the specific checkboxes, and it returns records with that checkbox set.  However, I hope there is a way to modify the search so it isn't as specific.  For example, a user clicks a, b, c, and it returns any records with a or b or c, or any combination of the 3 in that field.  Right now if I click a and b for example, it will only return records with a and b, not just a, and not just b.

       

      Any help/insight would be much appreciated.

       

      Craig

        • 1. Re: Checkbox Searches
          comment_1
             You need to script this, and create a separate request for each value in the search criteria.
          • 2. Re: Checkbox Searches
            philmodjunk
              

            You might also be able to implement a Go To Related record script step. If you use a relationship based on your check box fields, the different values will function as though you created multiple find requests. (find records that match value 1 or value 2 or value 3...)

             

            If you use this option, you have define the correct relationship and you may have to trap for the absence of any related records if you are also using GTRR to switch to a specified layout.

            • 3. Re: Checkbox Searches
              craig5005
                

              Sounds like it could work Philmodjunk.... however, I am not quite following you completely.  Could you elaborate a bit more?

               

              Thanks

              Craig

              • 4. Re: Checkbox Searches
                philmodjunk
                  

                Let's say you have a check box field with three values: Red, Blue, Green.

                 

                The field is a key field linking to a second field listing flowers Table::Colors--=--Flowers::Color

                 

                If you select both Red and Blue check boxes,

                 

                Go To Related Record [Show only related records; From Table: "Flowers" Using Layout "Flowers (Flowers)"]

                 

                will create a found set of all red and blue flower records and display them on the "Flowers" layout.

                 

                One catch you have to avoid, is that this script step fails silently when there are no matching records in "Flowers" for the values you select. If there are no matching records, the step takes you to the designated layout but does not modify the found set so you see whatever found set was present before you triggered the script.

                 

                Some developers check for this with by using the count function to count the number of matching related records others use Get ( LastError ) as this function returns 0 if you check it just after the GTRR step and there were matching related records.