Define the Metadata for the Custom Function (Managed Package)

For the managed package runtime, you must define the metadata required for a custom function in Salesforce.

Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

Note
Note

In release Vlocity Health and Insurance Spring '21 or later, you don't need to perform this task. Just use the FUNCTION function. See Function Reference (Managed Package).

  1. Go to Setup.
  2. In the Quick Find box, enter custom.
  3. Click Custom Metadata Types.
  4. Click Function Definition.
  5. Click Manage Function Definitions.
  6. Click New.
  7. Specify settings as follows:
    • Label: The function name displayed in the list on the Function Definitions tab.

    • Function Definition Name: The unique function name used by the API and managed packages, and which you use in formulas. The name must begin with a letter and use only alphanumeric characters and underscores. The name cannot end with an underscore or have two consecutive underscores.

    • ClassName: The Apex class containing the method that implements the logic for the function.

    • Method Name: The method that implements the logic for the function.

  8. To support the Apex code in the example above, you must add two function definitions with the following settings:
    • SUM

      • Label: SUM

      • Function Definition Name: SUM

      • ClassName: CustomFunctionImplementation

      • Method Name: sum

    • SPLIT

      • Label: SPLIT

      • Function Definition Name: SPLIT

      • ClassName: CustomFunctionImplementation

      • Method Name: split

  9. Click Save.