Logical
- Source
Methods
(static) and(values) → {boolean}
Returns TRUE if all of its arguments are TRUE.
Name | Type | Description |
---|---|---|
values | Array | The values to determine whether they are true or not. |
- Source
- See
- For further information, see docs.oasis-open.org
True if all of the arguments are true. False if any value is not true.
- Type:
- boolean
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.
Name | Type | Description |
---|---|---|
expressions | * | One or more expressions to evaluate. |
- Source
- See
- For further information, see www.hcltechsw.com
The resulting value of the last expression in the list.
- Type:
- *
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
- Source
- See
- For further information, see www.hcltechsw.com
(static) failure(message) → {string}
Returns text that indicates that input to a field does not meet validation.
Name | Type | Description |
---|---|---|
message | string | The error message to be displayed to the user. |
- Source
- See
- For further information, see www.hcltechsw.com
The message indicating the failure.
- Type:
- string
rosettajs.failure("Failure message test") // returns "Failure message test"
(static) false() → {boolean|number}
Returns the logical value false (or the number 0).
- Source
- See
- For further information, see www.hcltechsw.com and docs.oasis-open.org
False (or 0). and www.oasis-open.org
- Type:
- boolean |
number
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
- Source
- See
- For further information, see www.hcltechsw.com
(static) if(args) → {*}
Specifies a logical test to perform and returns the specified value determined by the test.
Name | Type | Description |
---|---|---|
args | * | The parameters that include the condition/action pair(s), and else action. |
- Source
- See
- For further information, see www.hcltechsw.com and docs.oasis-open.org
The resulting value if true or false. and www.oasis-open.org
- Type:
- *
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.
Name | Type | Description |
---|---|---|
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!. |
- Source
- See
- For further information, see www.hcltechsw.com and docs.oasis-open.org
The value you specify if a formula evaluates to an error; otherwise, returns the result of the formula.
- Type:
- *
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.
Name | Type | Description |
---|---|---|
value | * | The expression to compute. |
value_if_na | * | The result of the expression to return if the value is not #N/A. |
- Source
- See
- For further information, see docs.oasis-open.org
The value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.
- Type:
- *
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.
Name | Type | Description |
---|---|---|
args | Array | One or more conditions. |
- Source
- See
- For further information, see docs.oasis-open.org
The value that corresponds to the first TRUE condition.
- Type:
- *
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.
Name | Type | Description |
---|---|---|
value | * | The value to test for null. |
- Source
- See
- For further information, see www.hcltechsw.com
True if value is null, otherwise false.
- Type:
- boolean
rosettajs.isNull(null) // true
rosettajs.isNull(4) // false
(static) no() → {number}
Returns the number 0 (false).
- Source
- See
- For further information, see www.hcltechsw.com
The number 0 (false).
- Type:
- number
rosettajs.no() // returns 0
(static) not(logical) → {boolean}
Reverses the logic of its argument.
Name | Type | Description |
---|---|---|
logical | boolean | The expression to reverse. |
- Source
- See
- For further information, see docs.oasis-open.org
The reversed logic of the logical expression.
- Type:
- boolean
rosettajs.not(false) // returns true
(static) or(values) → {boolean}
Returns TRUE if any argument is TRUE.
Name | Type | Description |
---|---|---|
values | Array | The values to determine whether they are true or not. |
- Source
- See
- For further information, see docs.oasis-open.org
True if any one of the arguments are true. False if all values are false.
- Type:
- boolean
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.
Name | Type | Description |
---|---|---|
value | * | The value to return. |
- Source
- See
- For further information, see www.hcltechsw.com
The value.
- Type:
- *
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.
- Source
- See
- For further information, see www.hcltechsw.com
The number 1 (true).
- Type:
- number
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.
Name | Type | Description |
---|---|---|
args | Array | The expression and values to compare. |
- Source
- See
- For further information, see docs.oasis-open.org
The result corresponding to the first matching value.
- Type:
- *
rosettajs.switch() // returns
(static) true() → {boolean|number}
Returns the logical value true (or the number 1).
- Source
- See
- For further information, see www.hcltechsw.com and docs.oasis-open.org
True (or 1)
- Type:
- boolean |
number
rosettajs.true(); // returns true (openf) or 1 (notesf)
(static) v2If()
This function performs an @If operation; the syntax is the same as for @if.
- Source
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
- Source
- See
- For further information, see www.hcltechsw.com
(static) xor(values) → {boolean}
Returns a logical exclusive OR of all arguments.
Name | Type | Description |
---|---|---|
values | Array | 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. |
- Source
- See
- For further information, see docs.oasis-open.org
The logical exclusive OR of all arguments.
- Type:
- boolean
rosettajs.xor()
(static) yes() → {number}
Returns the number 1 (true).
- Source
- See
- For further information, see www.hcltechsw.com
The number 1 (true).
- Type:
- number
rosettajs.yes() // returns 1