Skip to content

alanpetersen/functions-demo

Repository files navigation

Salesforce Functions Demo

Basic Steps

  1. Get a Functions-enabled org (trial at https://functions.salesforce.com/signups)
  2. Enable Dev Hub (Setup > Development > Dev Hub)
  3. Enable Salesforce Functions (Setup > Feature Settings > Functions)
  4. Clone or create an SFDX project
  5. If creating a new project:
    1. Generate an SFDX project sf generate project -n MyProject -x
    2. Ensure that functions are enabled in the scratch org config file (config/project-scratch-def.json) features": ["Functions"]
  6. Create a scratch org sfdx force:org:create -s -f config/project-scratch-def.json -a FUNCTIONS002_SCRATCH
  7. Log into functions sf login functions
  8. Create a compute environment sf env create compute -o FUNCTIONS002_SCRATCH -a FUNCTIONS002_SCRATCH_COMPUTE
  9. Generate a function framework sf generate function -n processimage -l java
  10. Check changes into the git repository
  11. Deploy functions sf deploy functions -o FUNCTIONS002_SCRATCH

Useful Commands

  • Connect to an org
    • SFDX: sfdx force:auth:web:login -a ORG_ALIAS
    • SF: sf login org -a ORG_ALIAS
  • Set the default Dev Hub
    • SFDX: sfdx config:set defaultdevhubusername=ORG_ALIAS
    • SF: sf config set target-dev-hub= ORG_ALIAS
  • List connections
    • SFDX: sfdx force:org:list
    • SF: sf env list
  • Deploy Metadata
    • SFDX: sfdx force:source:deploy -u ORG_ALIAS -m MetadataType:MetadataName
    • SF: sf deploy metadata -o ORG_ALIAS -m MetadataType:MetadataName

Useful Links

About

Demo repo for Salesforce Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published