2 Replies Latest reply on Aug 8, 2013 8:47 AM by philmodjunk

    Problem with field of checkbox set



      Problem with field of checkbox set


           I have a field (Category) that is set to checkbox set so that multiple values (Student, Tutor, Staff, Prospect, Admin) can be chosen.

           On the other hand i have a script to check the value of this field to perform certain function. 

           If Table::Category = "Tutor" 



           I found that if i choose 2 or more values in the checkbox set e.g. Tutor & Admin, then the above script cannot function even Tutor is checked. What should I do?

        • 1. Re: Problem with field of checkbox set

               IF patterncount(Table::Category;"Tutor")

          • 2. Re: Problem with field of checkbox set

                 That will work just fine for this specific value list, but patterncount can fail with some sets of values in a checkbox field.

                 Example: If you have both the values "apple" and "applescript" in the value list for your checkbox field,

                 Patterncount  ( Table::CheckboxField ; "apple" )

                 will return a nonzero value (True) when applescript was the actual value selected.


                 Not IsEmpty ( FilterValues ( Table::CheckboxField ; "apple" ) )

                 will, generally speaking, be a more robust method for checking to see if a particular value was selected.