Courseiva

SF-PD2 Testing, Debugging, and Deployment Practice Question

A developer is using the Salesforce CLI to deploy a set of Apex classes and a custom object to a sandbox. The developer wants to validate the deployment without saving any changes to the target org. Which command should the developer use?

⚠ Common exam trap

The trap here is assuming that a --dry-run or --check-only flag exists for sf project deploy start, when validation is actually a separate command.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

sf project deploy validate

The Salesforce CLI provides the sf project deploy validate command specifically for validating a deployment without committing changes. It compiles the metadata and runs any specified tests, reporting errors without altering the target org. This is the correct command for a dry-run style validation in the modern Salesforce CLI, ensuring the deployment will succeed before actually deploying.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    sf project deploy start --dry-run

    Why it's wrong here

    The --dry-run flag is not a valid option for the sf project deploy start command. While it might seem intuitive, Salesforce CLI uses different flags for validation. Using an invalid flag will result in an error, and the deployment will not be validated. The correct approach is to use the --check-only flag, which performs a validation without saving changes.

  • ✓

    sf project deploy validate

    Why this is correct

    The sf project deploy validate command performs a deployment validation without saving any changes to the target org. It compiles the metadata and runs tests if specified, but does not commit the deployment. This is exactly what the developer needs to check for errors before an actual deployment. It is the correct CLI command for a validation-only deployment.

  • ✗

    sf project deploy report --status

    Why it's wrong here

    The sf project deploy report command is used to check the status of an existing deployment, not to initiate a validation. It requires a deployment ID and simply retrieves the status. It does not perform any validation of new metadata. This command would not help the developer validate a new deployment without saving changes.

  • ✗

    sf project deploy start --check-only

    Why it's wrong here

    The --check-only flag is used with the older force:mdapi:deploy command, but in the new sf project deploy start command, validation is handled by the separate sf project deploy validate command. Using --check-only with sf project deploy start is not valid and will cause an error. The developer should use the dedicated validate command instead.

About these practice questions

This SF-PD2 question is part of Courseiva's 226-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Salesforce exam blueprint

This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.