When you set up an invoice solution that uses Invoice modules, you type expressions for validating numerical fields (including barcode fields) in the Validation settings of an invoice field profile.
The table below shows the characters that are valid in those expressions.
Character |
Meaning |
Example |
|
||
+ |
Plus |
=FieldA+FieldB |
- |
Minus |
=FieldA-FieldB |
: |
Sum of fields from/to |
<FieldA:FieldB |
* |
Multiply |
>FieldA*10 |
/ |
Divide |
=FieldA/2 (If both operands are integers, the result is an integer.) |
% |
Remainder |
=FieldA%100 (returns the remainder of FieldA / 100) |
|
||
? |
Does the field exist? |
=?FieldB (returns 1 if the field exists, otherwise 0) |
|
||
= |
Equal to |
=100 |
> |
Greater than |
>FieldC |
< |
Less than |
<FieldC |
>= |
Greater than or equal to |
FieldA>=FieldB |
<= |
Less than or equal to |
FieldA<=FieldB+FieldC |
|
||
; |
And (between two expressions) |
FieldA=FieldB+FieldC; FieldA=FieldD |
|
||
( ) |
Parentheses |
(FieldA+FieldB)*FieldC |
Spaces around operators are allowed. However, they limit the space available for typing your expression.
Keep in mind that field names are case-sensitive.
Nested parentheses are not allowed.
There are two types of expressions. For more information, click the one that applies to your situation:
Type 1 validates the current field in relation to other fields.
Type 2 validates any numerical field in the invoice profile.
If the current field is non-numeric, the expression must be type 2 and validate another field, because non-numeric fields cannot be validated by an expression. Furthermore, when you use a semicolon as the AND operator, the expression must always be type 2.