AgileApps Support Wiki Pre Release

Logical

From AgileApps Support Wiki

Logical fields in Formula Functions:

AND

IF

ISCHANGED

ISNEW

ISNULL

NOT

OR

AND

The AND function evaluates two logical arguments. If both arguments are true, this function returns TRUE. If one or both of the arguments are false, then this function returns FALSE.

Syntax
AND(logical1, logical2)
Element Description
logical1 Any argument that returns a Boolean value of TRUE or FALSE.
logical2 Any argument that returns a Boolean value of TRUE or FALSE.
Return
TRUE or FALSE
Example
AND(true, true) = TRUE
AND(true, false) = FALSE
AND(false, true) = FALSE
AND(false, false) = FALSE

IF

The IF function evaluates a logical argument. If the first parameter is true, this function returns the second parameter. If the first parameter is false, this function returns the third parameter.

Syntax
IF(logical_test, value_if_true, value_if_false)
Return
Text string
Example
IF(TRUE,'The test is true', 'The test is false') = 'The test is true'
IF(FALSE,'The test is true', 'The test is false') = 'The test is false'

ISCHANGED

The ISCHANGED function returns TRUE if the given field has changed from its PRIORVALUE. If the field has not changed, the function returns FALSE.

Syntax
ISCHANGED(field)
Return
TRUE or FALSE
Example
ISCHANGED(last_name) = TRUE

ISNEW

The ISNEW function determines if the current record is being added. If the record is being added, it returns TRUE. If it is being updated, the function returns FALSE.

Syntax
ISNEW()
Return
TRUE or FALSE
Example
IF ( ISNEW() , value-if-true, value-if-false)


ISNULL

The ISNULL function determines if a text field contains data. If the field has no data (value is null or empty), the function returns TRUE. If the field contains data, the function returns FALSE.

Syntax
ISNULL(field)
Return
TRUE or FALSE
Examples
ISNULL(last_name) = TRUE
IF(ISNULL(NULLDATE()), 'TRUE', 'FALSE')

NOT

The NOT function reverses the value of its Boolean argument. For example, a FALSE value is returned as TRUE.

Syntax
NOT(logical)
Return
TRUE or FALSE
Example
NOT(TRUE) = FALSE
NOT(FALSE) = TRUE

OR

The OR function evaluates two arguments and returns TRUE of one or both of the arguments are true. The function returns FALSE if both arguments are false.

Syntax
OR(logical1, logical2)
Element Description
logical1 Any argument that returns a Boolean value of TRUE or FALSE.
logical2 Any argument that returns a Boolean value of TRUE or FALSE.
Return
TRUE or FALSE
Example
OR(TRUE, TRUE) = TRUE
OR(TRUE, FALSE) = TRUE
OR(FALSE, TRUE) = TRUE
OR(FALSE, FALSE) = FALSE

PRIORVALUE

The PRIORVALUE function returns the value of the field, in the Return Type of the field.

Syntax
PRIORVALUE(field)
Return
The field's prior value.
Example
PRIORVALUE(profit)