Comparison Statements in Formulas and Mandatory Rules
Rules for mandatory user-defined fields consist of comparison statements. Formula user-defined fields may also include comparison statements if the formulas include conditional expressions, using “If” statements.
You can create comparison statements with the following symbols:
- == to check that two values are equal to each other.
- For example, [Category] == “Partner” verifies that the Category field is set to “Partner”.
- != to check that two values are not equal to each other.
- For example, [Category] != “” verifies that the Category field is not empty, i.e. it has a value.
- > to check that the first value is greater than the second value.
- For example, [Annual Sales] > 20000 verifies that the Annual Sales user-defined field has a value greater than 20,000.
- < to check that the first value is less than the second value.
- For example, [Contract Expiry Date] < [Last Service Date] verifies that the Contract Expiry Date field is earlier than the Last Service Date field.
- >= to check that the first value is greater than or equal to the second value.
- <= to check that the first value is less than or equal to the second value.
You can compare any values including alphanumeric, date, and numeric values. Alphanumeric values are compared by checking the alphabetical order of the string. When you compare values from table fields, they are treated as alphanumeric values.
[City] == "Vancouver"
is true only if the value of the City field is set to
Lowercase([City]) == "vancouver"
is true if the value of the City field is set to
"Vancouver", "vancouver", OR "VANCOUVER".
For example, the statement
[Category] == "Partner"
will be true only if the only value set in the Category field is
If the Category field also includes the value
the rule would validate with the following statement:
Category == "Distributor, Partner"