Rules & Checkbox Fields

By definition, checkbox fields have two values, checked and unchecked.  However in reality database technology really has three values under the covers:

  • Not Set
  • Checked
  • Unchecked

There are differences in the way that Not Set and Unchecked are handled internally, but if you adhere to the following way to set and to unset the values of a checkbox, ExtraView will handle the internal differences.

To set a value:

MY_CHECKBOX = 'Y';

To uncheck a value:

MY_CHECKBOX = 'N';

To check whether a checkbox is set:

if (MY_CHECKBOX = 'Y') { ..... };

To check whether a checkbox is not checked:

if (MY_CHECKBOX = 'N') { ..... };

You should not use, or test for the Not Set (sometimes known as the null value) within your rules.