Explore Solutions and Sample Code

Get help using 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 and the eCars sample app.

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 can be invoked from your org.

Use Java and your favorite Java frameworks to build a Function that can be invoked from your org.

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 Functions projects and compute environments.
  • Developer Guide: Deploy a Function Steps for connecting an org with 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.