Use the Salesforce Functions features in VS Code to build event-driven, elastically scalable apps and experiences. You can create and test functions against sample payloads locally in VS Code.
This command creates a new directory named after your Function name and all the supporting files.
- VS Code creates the basic scaffolding that contains files with some rudimentary, boilerplate code and supporting metadata.
package.jsonfile contains information about dependencies.
SFDX: Start Function to run the function locally.
The Salesforce extensions add the
Debug Invoke CodeLens to a file that is in the correct format to send test events to a Function that is running locally. With one click, you can test a function that is running, by invoking it with a mock payload. You can also debug the function against the payload.
payload.json file that can invoke a function:
Stop a function by running
SFDX: Stop Function, which simply kills the local process.
For more information see Developing Salesforce Functions using VSCode.