Custom Function Syntax Rules
Due to the independent nature of custom functions, there are some limitations:
- You cannot use report or database fields, including summary fields, in a custom function.
- You cannot use shared or global variables in a custom function, but you can pass a global or shared variable in as an argument when calling a custom function from within a formula.
- You cannot use recursion, either direct or indirect, in a custom function.
- You cannot directly use UFLs in a custom function.
- You cannot call Evaluation Time, Print State, or Document Properties functions. Also, you cannot use the functions: Rnd, CurrentFieldValue, DefaultAttribute and GridRowColumnValue.
These restrictions are designed to make custom functions independent of the report they are being used in.
Variables
You can use local variables and argument variables in custom functions. If you need to use a shared or global variable in your custom function, you can pass it in as an argument.
See Also
Creating Custom Functions | Basic Syntax for Custom Functions | Crystal Syntax for Custom Functions