Section 5 · Testing, Debugging, and Deployment · 20% of exam
5.3 Salesforce DX, Developer Tools, Environments, and
Exam objective
Given a scenario, choose Salesforce developer tools, explain deployment environments and requirements, and plan a controlled release of code and configuration.
Deployment
Select the tool for the task
Developer Console supports quick inspection, anonymous Apex, logs, and test execution in an org. Salesforce CLI supports repeatable commands for org authentication, project work, testing, source retrieval, and deployment. Salesforce DX provides a project structure and development lifecycle that works with version control and disposable scratch orgs. Visual Studio Code with Salesforce extensions offers an integrated editor and uses the CLI behind the scenes. The exam objective names Salesforce DX, Salesforce CLI, and Developer Console; match each to the work described rather than treating them as interchangeable.
For a small diagnostic, Developer Console may be sufficient. For source-controlled development across multiple orgs, a DX project and CLI or editor workflow provide repeatability. For automated CI, scripted CLI commands can validate and deploy a known source set. A tool's convenience does not remove the need to authenticate to the correct org and verify the target before deployment.
Understand org development environments
A Developer Edition org or developer sandbox can support individual development. Scratch orgs are short-lived, source-driven orgs useful for isolated work in supported Salesforce DX models. Sandboxes provide copies of production configuration and, depending on type, data; teams use them for development, integration, user acceptance testing, and staging. A production org is the live environment, not a safe place for experimental development. A controlled path usually moves a reviewed change from development to integration or testing, then to staging and production. The exact pipeline depends on the organization. Source control records what changed, who approved it, and how the release can be reproduced. A sandbox may not match production in every data or integration detail, so validate important dependencies and configuration in an environment that represents the target as closely as practical.
Deploy metadata as a dependency set
A Salesforce application includes more than Apex. A feature may require custom objects, fields, tabs, permission sets, Lightning components, flows, record types, layouts, and tests. A class can compile locally but fail in a target org if a referenced field or permission set is missing. Identify dependencies, package them in a manifest or source set, and validate the deployment against the target org.
Before production, run the required tests and any project-specific checks, review profile or permission changes, and confirm Flow activation behavior. A deployment validation can detect many issues before the change is committed. Use the current CLI reference for exact command syntax because command flags evolve. Keep deployment credentials and secrets out of source files, and use the organization's approved authentication and release controls.
A release decision checklist
- Is the source under version control and reviewed? 2. Does the deployment include every metadata dependency? 3. Were relevant Apex and Flow tests run, including user-access scenarios? 4. Was the change validated in a target-like org?
- Is there a clear deployment owner, rollback or remediation plan, and post-deploy check?
A source deployment can overwrite metadata in the target org. Verify the selected org, files, and manifest before deploying, and avoid direct experimental changes in production.
Extra concept: source tracking and org changes
In source-driven workflows, source tracking helps identify changes between a local project and a scratch or sandbox org. In org development models without source tracking, retrieve and compare metadata deliberately. A reliable process makes the local source of truth explicit so that changes made directly in an org are not silently lost or omitted from the release.
Key takeaways
- Use Developer Console for quick org tasks, CLI for repeatable command workflows, and DX for source-centered lifecycle practices.
- Develop and validate outside production, then move a reviewed metadata dependency set through the organization's release stages.
- Tests, deployment validation, correct target selection, permissions, and post-deployment checks are all part of deployment readiness.
- Official references:
- Salesforce Certified Platform Developer Exam Guide: https://help.salesforce.com/s/articleView?id=005298965&language=en_US&type=1
- Salesforce DX development models: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/development-models.html
- Org development model: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/orgdev.html
- Deploy source: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/deploy-source.html
- Deploy and retrieve changes: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/deploy-changes.html
- Salesforce CLI setup: https://developer.salesforce.com/docs/platform/sfdx-setup/guide/sfdx-setup-intro.html
- Salesforce CLI command reference: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference.html
