Logical

Methods

(static) and(values) → {boolean}

Returns TRUE if all of its arguments are TRUE.

Parameters:
NameTypeDescription
valuesArray

The values to determine whether they are true or not.

See
Returns:

True if all of the arguments are true. False if any value is not true.

Type: 
boolean
Example
rosettajs.and(true, false) // returns false

(static) do(expressions) → {*}

Evaluates expressions from left to right, and returns the value of the last expression in the list.

Parameters:
NameTypeDescription
expressions*

One or more expressions to evaluate.

See
Returns:

The resulting value of the last expression in the list.

Type: 
*
Example
rosettajs.do(rosettajs.success(), true, false, "message") // returns "message"

(static) doWhile()

Executes one or more statements iteratively while a condition is true. Checks the condition after executing the statements. No plans to implement - Convert to Native JS

See

(static) failure(message) → {string}

Returns text that indicates that input to a field does not meet validation.

Parameters:
NameTypeDescription
messagestring

The error message to be displayed to the user.

See
Returns:

The message indicating the failure.

Type: 
string
Example
rosettajs.failure("Failure message test") // returns "Failure message test"

(static) false() → {boolean|number}

Returns the logical value false (or the number 0).

See
Returns:

False (or 0).   and  www.oasis-open.org

Type: 
boolean | number
Example
rosettajs.false(); // returns false (openf) or 0 (notesf)

(static) for()

Executes one or more statements iteratively while a condition remains true. Executes an initialization statement. Checks the condition before executing the statements and executes an increment statement after executing the statements. No plans to implement - Convert to Native JS

See

(static) if(args) → {*}

Specifies a logical test to perform and returns the specified value determined by the test.

Parameters:
NameTypeDescription
args*

The parameters that include the condition/action pair(s), and else action.

See
Returns:

The resulting value if true or false.   and  www.oasis-open.org

Type: 
*
Example
rosettajs.if(55 >= 12.45, "Over Budget", "OK") // returns "Over Budget"

(static) ifError(value, value_if_error) → {*}

Returns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.

Parameters:
NameTypeDescription
value*

The argument that is checked for an error.

value_if_error*

The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.

See
Returns:

The value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.

Type: 
*
Example
rosettajs.ifError(error.value, 2) // returns 2

(static) ifNA(value, value_if_na) → {*}

Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.

Parameters:
NameTypeDescription
value*

The expression to compute.

value_if_na*

The result of the expression to return if the value is not #N/A.

See
Returns:

The value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.

Type: 
*
Example
rosettajs.ifNA(error.na, 2) // returns 2

(static) ifs(args) → {*}

Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.

Parameters:
NameTypeDescription
argsArray

One or more conditions.

See
Returns:

The value that corresponds to the first TRUE condition.

Type: 
*
Example
rosettajs.ifs(false, 1, true, 2) // returns 2

(static) isNull(value) → {boolean}

Tests for a null value. Returns true only if a value is a single text value that is null, otherwise it returns false. This function also returns false if the value is an error.

Parameters:
NameTypeDescription
value*

The value to test for null.

See
Returns:

True if value is null, otherwise false.

Type: 
boolean
Examples
rosettajs.isNull(null) // true
rosettajs.isNull(4) // false

(static) no() → {number}

Returns the number 0 (false).

See
Returns:

The number 0 (false).

Type: 
number
Example
rosettajs.no() // returns 0

(static) not(logical) → {boolean}

Reverses the logic of its argument.

Parameters:
NameTypeDescription
logicalboolean

The expression to reverse.

See
Returns:

The reversed logic of the logical expression.

Type: 
boolean
Example
rosettajs.not(false) // returns true

(static) or(values) → {boolean}

Returns TRUE if any argument is TRUE.

Parameters:
NameTypeDescription
valuesArray

The values to determine whether they are true or not.

See
Returns:

True if any one of the arguments are true. False if all values are false.

Type: 
boolean
Example
rosettajs.or(true, false) // returns true

(static) return(value) → {*}

Immediately stops the execution of a formula and returns the specified value. This is useful when you only want the remainder of the formula to be executed only if certain conditions are True.

Parameters:
NameTypeDescription
value*

The value to return.

See
Returns:

The value.

Type: 
*
Example
rosettajs.return('Message to return') // throws 'Message to return'

(static) success() → {number}

Returns 1 (True). Use this function with @If in field validation formulas to indicate that the value entered satisfies the validation criteria.

See
Returns:

The number 1 (true).

Type: 
number
Example
rosettajs.success() // returns 1

(static) switch(args) → {*}

Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.

Parameters:
NameTypeDescription
argsArray

The expression and values to compare.

See
Returns:

The result corresponding to the first matching value.

Type: 
*
Example
rosettajs.switch() // returns

(static) true() → {boolean|number}

Returns the logical value true (or the number 1).

See
Returns:

True (or 1)

Type: 
boolean | number
Example
rosettajs.true(); // returns true (openf) or 1 (notesf)

(static) v2If()

This function performs an @If operation; the syntax is the same as for @if.

Throws:

No plans to implement

Type
Error

(static) while()

Executes one or more statements iteratively while a condition is true. Checks the condition before executing the statements. No plans to implement - Convert to Native JS

See

(static) xor(values) → {boolean}

Returns a logical exclusive OR of all arguments.

Parameters:
NameTypeDescription
valuesArray

logical1, logical2,… Logical 1 is required, subsequent logical values are optional. 1 to 254 conditions you want to test that can be either TRUE or FALSE, and can be logical values, arrays, or references.

See
Returns:

The logical exclusive OR of all arguments.

Type: 
boolean
Example
rosettajs.xor()

(static) yes() → {number}

Returns the number 1 (true).

See
Returns:

The number 1 (true).

Type: 
number
Example
rosettajs.yes() // returns 1