Explore Solutions and Sample Code

Get help using Salesforce Functions to solve specific problems.

Our library of solutions covers all aspects of creating and working with Salesforce Functions. Many solutions include links to sample code that you can use as a starting point for your function development.

Check out these GitHub repositories, which contain Salesforce Functions recipes.

Use the Salesforce SDKs, along with other standard Salesforce APIs, to access org resources.

Functions, unlike Apex, don't automatically handle data transactions for you. Transactions ensure that all related data changes are made at the same time and that they can be undone if necessary. To manage transactions in a function, use the UnitOfWork SDK class.

Use JavaScript or TypeScript along with your favorite Node frameworks to build a function that your org can invoke.

Use Java and your favorite Java frameworks to build a function that your org can invoke.

Do you have Apex code that is hitting Apex compute limits? Transition your Apex code to a function using patterns and best practices, and take advantage of elastic auto-scaling in Salesforce Functions compute environments.

Before you deploy your function, you can run and debug it locally.

Learn how to integrate your function code and function invocation code in your testing pipeline.

Like any Salesforce org custom development, you need to manage how and where functions are tested and deployed. Functions compute environments are tied to orgs, helping you avoid deploying an in-development function to a production org.

Before a Function can be invoked from a Salesforce org, it must be deployed to a Salesforce Functions compute environment associated with the org.

  • Overview Understanding Salesforce Functions projects and compute environments.
  • Developer Guide: Deploy a Function Steps for connecting an org with Salesforce Functions, creating compute environments, and deploying function projects to compute environments.

Salesforce makes it easy to invoke a deployed function from your org, using Salesforce features you're already familiar with, like Apex. You can invoke a function from your org synchronously or asynchronously as easily as calling an Apex method.

When invoked, functions use specific permission sets for data access. Understand what permissions you can set, which permission sets to use, and what user role runs the functions.