When creating a new custom function, you can enter its logic directly in the Custom Function Editor, or you can extract the logic from an existing report formula.
Using the Custom Function Editor is like using the Formula Editor to create a report formula. For information on how to use the Formula Editor, see the Formula Editor. For more information on what syntax to use when writing a custom function, see Basic Syntax for Custom Functions or Crystal Syntax for Custom Functions.
Tip Ctrl+Space brings up a list of the available functions. If you've already started typing, it brings up a list of keywords that are possible matches for what you've already typed.
Once the custom function has been saved, you can modify it or use it in report formulas as needed.
When you extract a custom function from an existing formula, the program copies the formula and replaces its fields with arguments.
Note A custom function created using the Extractor can return only simple types, like strings and integers. It cannot return arrays. To create a custom function that can return arrays, use the Custom Function Editor. For more information on return types and the syntax rules associated with custom functions, see Basic Syntax for Custom Functions or Crystal Syntax for Custom Functions.
To extract a custom function from an existing formula
Once you've selected a formula, the Return Type, Arguments, and Formula Text fields are completed with information that relates to that formula. These fields cannot be changed without selecting a different formula.
The remaining fields are optional. See Extract Custom Function from Formula dialog box for a description of each.
Tip
Once the custom function has been extracted and saved, you can modify it or use it in report formulas as needed.
Note You cannot add new arguments to your custom function while you are creating it in the Extract Custom Function from Formula dialog box. To add new arguments, save the custom function and modify it in the Custom Function Editor.
Basic Syntax for Custom Functions | Crystal Syntax for Custom Functions | Advantages of Using Custom Functions | Custom Functions Work Flow | Custom Functions