An expression is a description of how to compute a value. It can call a function, be a reference to a field, or be a literal. Expressions can also be composed of one or more of these with operators in between them.
Expressions are used in many places throughout Service Manager, including in business rules, saved searches, quick action definitions, list filters, visibility rules on form controls, and more.
Most expressions simply compute a value. However, a few of the built-in functions do more than just compute a value. They affect the application in ways other than returning a value. For example, the Prompt function prompts the user for an input, and the GetNext Counter function returns the value of the counter but also increments the counter.
A subexpression is an expression within an expression that computes a value, but has a different context and may also be evaluated more than once. Currently, subexpressions can only be passed as arguments to certain built-in functions. The ChildFold, FindAncestor, ForEachChild, IfAllSiblings, IsTrueForAllChildren, Prompt, and PromptAndExecuteAction are the only built-in functions that use subexpressions.
An example of a subexpression is:
$(FindAncestor("Frs_CompositeContract_Entity", "ServiceAgreement", EntityLink_RecID,
"$((ServiceLink == [OtherObject]Service_Valid) && (Status == \"Published\"))"
The sub expression starts with "$((ServiceLink.
There are two ways to call a subexpression: the "old" way, which is to enter the entire subexpression as a string within double quotes, or the "new" way, which is to enter it without double quotes. (If you use the new way, you do not need to use the backslash to escape the quotes within the string.)
In this example, the function looks for an ancestor and for each one it finds, it evaluates the subexpression and each time it evaluates it, it has a different subcontext. The field references in the subexpression do not refer to the same object as the field references outside of the subexpression.
At the outer level, enclose an expression, function, or field reference with a dollar sign with parentheses, as follows:
The $( can only appear as the outer most portion of the expression, and should not appear anywhere within the expression itself, except as a subexpression. If you enter $( anywhere else within the expression, the parser cannot interpret the expression properly, and incorrectly interprets the entire expression as if it were a regular text literal.
In certain cases, the parser does allow for expressing simple values, without requiring the use of $(). An example is expressing simple text literal values such as "Active".
At this time, Service Manager does not allow you to add comments to expressions.
At the highest level, you enter either an expression or a standalone literal.
To call a built-in function, use this syntax:
where arguments can be zero or more arguments to the function, separated by commas. The arguments can be expressions that compute values, field references, or literals.
See Working with Built-in Functions for complete information about all of the Service Manager built-in functions.
The values in expressions are represented as either floating point numbers or integers. Service Manager supports 32-bit and 64-bit integers.