Operators

CRMScript assignment operators

The assignment operators store a value in a variable (on the left side of the operator).

The standard assignment operator is =. Also, CRMScript has operators that combine an arithmetic operation with the assignment for a more compact notation.

OperatorDescriptionSame as
+=add and assignx = x + 2
-=subtract and assignx = x - 2

CRMScript arithmetic operators

The arithmetic operators do math with numbers, either Integer or Float.

OperatorDescription
+add
-subtract
*multiply
/divide
%reminder
++increment
decrement

CRMScript string operators

The + operator concatenates 2 strings.

String text1 = "Super";
String text2 = "Office";
String fullText = text1 + text2;

The result of fullText will be SuperOffice.

The += operator appends the right-side string to the left-side variable.

fullText += " AS";

This will change our existing string to SuperOffice AS.

CRMScript comparison operators

Comparison operators are used to test for true or false. They are typically used in conditional statements: you compare 2 values and the result determines what happens next.

OperatorDescription
==equal
!=not equal
<less than
>greater than
<=less than or equal
>=greater than or equal

CRMScript logical operators

The logical operators are commonly used with boolean values and variables (Bool).

OperatorDescriptionUse
&&logical ANDexpr1 && expr2
|logical ORexpr1 | expr2
!logical NOT!expr

Operator precedence

CRMScript operators follow the same precedence as in mathematics. For example, multiplication is done before addition.

Operators at the same precedence level are evaluated left-to-right. If you want to group expressions, use parentheses to specify the resolution.

Integer x = 5 + 2 * 3;
Integer y = ( 5 + 2 ) * 3;

In this example, x is 11 while y is 21. The only difference between the assignment statements being the parentheses.