> This page is for Docs.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://zuora.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://zuora.ferndocs.com/_mcp/server.

# Create a function from templates

> Learn how to create a function from built-in templates.

Learn how to create a function from built-in templates.

To create functions, you must have a basic understanding of JavaScript functions. For more information, see [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) and [Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions) in MDN Web Docs.

Navigate to **Custom logic entry** in the left navigation menu.

Click **Create Logic** and then click **Create from Templates**.

In the “Choose a template from library” dialog, select the template on which the function is based:

1. Click **Functions** in the **Categories** section.
2. Select an object from the dropdown list.
3. Select a template in the **Functions** section. Available templates vary depending on the object you selected in step b.

Optional: In the Create New Logic dialog, update the prepopulated information as needed:

* Name
* Description

Click **Save And Continue**. The function editor opens.

Optional: Update the JavaScript code and test the function. For more information, see [Test a function](/docs/platform/extensibility/custom-logic/function/function-management/test-a-function).

If you want to activate the function, click **Activate**. Active functions are effective immediately, whereas draft functions are not. Note that only one active function is allowed for each object.

Click **Save**.