NexJ Logo

Formula functions

Functions are named statements that perform specific tasks in field control formulas. A function takes a set of inputs, does work on them, then outputs a result.

Syntax

<functionName>(<arguments>)

Inputs

The inputs of a function are referred to as arguments. Arguments can be date, integer, number, string, Boolean, or null values. Each function accepts a defined set of arguments. For example, the Year() function accepts a date argument and a string argument, and the Sqrt() function accepts only a number argument.

Most functions take one or more arguments, which can be required or optional. For example, in the Year() function, the date argument is required, but the string argument is optional.

Outputs

The output of a function is referred to as the result. Functions return only one result, which can be a date, integer, number, string, or Boolean value. The kind of result that a function returns depends on which function is used. For example, the Date() function returns a date value, and the Round() function returns a number value.

Some functions can return a null value.

When you use a function as part of a larger expression, the result of the function takes the place of the function in the expression. For example, the expression Round(2.4) + Round(2.6) is evaluated as 2.0 + 3.0. This is also true when you use a function as an argument in another function. For example, the expression Sqrt(Round(4.1)) is evaluated as Sqrt(4.0).