Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Last active July 1, 2021 10:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msrivastav13/581ea2a1ad8199707a444c08434b740d to your computer and use it in GitHub Desktop.
Save msrivastav13/581ea2a1ad8199707a444c08434b740d to your computer and use it in GitHub Desktop.
salesforce functions cheatsheet
//Create a salesforce functions
$ sfdx evergreen:function:init <MyFunction> -l typescript -m force-app/main/default
// Start a function
$ cd functions/MyFunction
$ sfdx evergreen:function:start --verbose
// $ sfdx evergreen:function:invoke \
http://localhost:8080 \
--payload='{"fields":["Id","Name"]}' \
-u <your scratch org alias>
[Win]
$ sfdx evergreen:function:invoke ^
http://localhost:8080 ^
--payload='{\"fields\":[\"Id\",\"Name\"]}' ^
-u <your scratch org alias>
[Win Powershell]
$ sfdx evergreen:function:invoke `
http://localhost:8080 `
--payload='{"fields":["Id", "Name"]}' `
-u <your scratch org alias>
//Deploy the function steps
//Set target
$ sfdx evergreen:target:set MyTarget -s Helsinki -a imageprocessingapp
// login
$ sfdx evergreen:auth:login
// Deploy command
$ sfdx evergreen:function:deploy -t MyTarget
// Bind Function
$ sfdx evergreen:org:bind "instance name" -t MyTarget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment