PD1 Deployment Strategies 2 — Questions and Answers
Question 1: Which Salesforce tool allows developers to compare metadata between two orgs or between an org and a local directory?
- Workbench
- Salesforce CLI (sf org diff) (Correct answer)
- Change Set Manager
- Metadata Explorer
Correct answer: Salesforce CLI (sf org diff)
The Salesforce CLI provides the 'sf org diff' command to compare metadata between orgs or between an org and a local directory.
Question 2: What happens to a record-triggered Flow when it is deployed to a new org via a Change Set?
- It deploys as Inactive and must be manually activated (Correct answer)
- It deploys as Active automatically
- It deploys as Draft and requires republishing
- It cannot be deployed via Change Set
Correct answer: It deploys as Inactive and must be manually activated
Flows deployed via Change Sets arrive in Inactive status and must be manually activated in the destination org.
Question 3: A developer needs to deploy only a subset of components from a package.xml. Which approach achieves this without modifying the original package.xml?
- Use a .forceignore file to exclude unwanted components
- Create a destructiveChanges.xml
- Use a separate package.xml with only the desired components (Correct answer)
- Use the --ignore-conflicts flag
Correct answer: Use a separate package.xml with only the desired components
Creating a separate package.xml listing only the desired components is the cleanest way to deploy a subset of metadata.
Question 4: Which deployment method is BEST suited for complex environments requiring approval gates between Dev, QA, and Production?
- Change Sets
- Salesforce CLI with a CI/CD pipeline (Correct answer)
- Ant Migration Tool
- Manual metadata drag-and-drop
Correct answer: Salesforce CLI with a CI/CD pipeline
Salesforce CLI integrated with a CI/CD pipeline supports automated testing, approval gates, and controlled progression across environments.
Question 5: What is the purpose of the 'sf project deploy preview' command?
- Deploys metadata and returns a preview report
- Shows what would be deployed without actually deploying (Correct answer)
- Validates metadata without running tests
- Generates a package.xml from local source
Correct answer: Shows what would be deployed without actually deploying
'sf project deploy preview' performs a dry run showing which components would be deployed without making any changes to the org.
Question 6: When deploying to a production org, which test level runs all tests in the org including tests not in the deployment package?
- RunLocalTests
- RunSpecifiedTests
- RunAllTestsInOrg (Correct answer)
- RunPackageTests
Correct answer: RunAllTestsInOrg
RunAllTestsInOrg executes every Apex test in the org, including managed package tests, not just those related to the deployment.
Question 7: A developer wants to exclude certain files from source tracking and deployment. Which file should they configure?
- .gitignore
- .forceignore (Correct answer)
- package.xml
- destructiveChanges.xml
Correct answer: .forceignore
.forceignore works like .gitignore but specifically tells Salesforce CLI which files to ignore during source tracking and deployments.
Which Salesforce tool allows developers to compare metadata between two orgs or between an org and a local directory?