Defining user-defined functions

Although you define global functions in the Function painter and object-level functions in the painter for a specific object, in both cases you define and code the function in a Script view.

When you add a new function, a Prototype window displays above the script area in the Script view. The fields in the Prototype window are in the same order as the function’s signature:

The Prototype fields of the Script view are shown

The following sections describe each of the steps required to define and code a new function:

  1. Opening a Prototype window to add a new function.

  2. Defining the access level (for object-level functions).

  3. Defining a return type.

  4. Naming the function.

  5. Defining arguments.

  6. Defining a THROWS clause.

  7. Coding the function.

  8. Compiling and saving the function.