Skip to content
StackDecode
AdvancedLesson 31 of 37

Salesforce DX and source-driven development

Treat your org's configuration as code.

Salesforce CLI (sf) plus VS Code and the Salesforce Extension Pack.

bash
sf org login web --alias mydev
sf project generate --name my-app
sf org create scratch --definition-file config/project-scratch-def.json --alias scratch1
sf project deploy start --source-dir force-app
sf project retrieve start
sf apex run test --test-level RunLocalTests --result-format human

Source lives in git as metadata (force-app/main/default). Scratch orgs are disposable orgs built from a definition file, and source tracking shows what changed.