Language Elements

The following language elements are supported by the Formula field on the Configurable Formula page.

Item

Description

Comments

Use ## or // to define a single line comment within the expression.

Use /*…*/ for multi-line comment.

Examples:

## Doing something

// Run for loop

/* Multi-line

Comment */

Identifiers/Variables

Must use a-z, A-Z, _ or $. Can be followed by 0-9, a-z, A-Z, _ or $.

Examples:

var1, myValue,

Notes:

  • Variable names are case-sensitive. For example, MyValue and myValue are different variables.

  • The following keywords are reserved and cannot be used in variable names: or, and, eq, ne, lt, gt, le, ge, div, mod, not, null, true, false, new, var, and return.

Local Variables

Use keyword var followed by the variable name, as per the standards.

Examples:

  • Basic Declaration: var value;

  • With Assignment:  var value = 25;

Local variables scope is the entire scope and they take precedence on resolution over contextual variables.

Statements

A statement can be the empty statement, the semicolon (;), block, or an expression. Statements are optionally terminated with a semicolon.

Block

A block is multiple statements inside curly braces.

Assignment

Assign the variable value with a literal or use a context as initial resolver.

Method Calls

Use standard JAVA standard to call the method of an object.