---
schema_version: "1"
id: fd3080b5db67839fec931adb3f2865aa89aa75562fdbfa5b435173c2557efa81
title: Define the Metadata for the Custom Function (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_define_the_metadata_for_the_custom_function.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_define_the_metadata_for_the_custom_function.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8a58daf99fc549ed2c7c49adf581e107af7c7f3147a6bf3abf4960bdd4490e2e
description: For the managed package runtime, you must define the metadata required for a custom function in Salesforce.
products:
  - Omnistudio
release: "264"
---
# 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

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)](https://help.salesforce.com/s/articleView?id=xcloud.os_function_reference.htm&release=264.0.0&type=5 "For the managed package runtime, use these operators and functions in Omnistudio Data Mappers and Integration Procedures, and in Vlocity Intelligence, eligibility rules, underwriting rules, state rules, and calculation procedures.").

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**.