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.

Visit Sample Code Repositories 

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

Access Org Data from a Function 

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

Manage Transactions in a Function 

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.

Develop JavaScript and TypeScript Functions 

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

Develop Java Functions 

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

Migrate Apex Code to Functions 

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.

Run and Debug Functions Locally 

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

Test Functions 

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

Understand Functions and Application Lifecycle Management 

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.

Deploy Functions to a Compute Environment 

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.

Invoke Functions from Your Org 

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.

Configure Permission Sets for Functions 

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.

Product Retirement Announcement

Salesforce Functions is no longer available for purchase or renewal. To preserve the capabilities that Salesforce Functions provided to your org, deploy an alternative solution before your existing order term ends. See Salesforce Functions Retirement for more information on migrating your functions. Contact your Salesforce Account Executive for more information on Heroku.