What is the difference between force:source:deploy and force:mdapi:deploy?

Dive into the Architect Journey – Development Lifecycle and Deployment Exam. Prep with tailored flashcards, explore multiple choice questions with detailed explanations, and enhance your readiness for the test!

Multiple Choice

What is the difference between force:source:deploy and force:mdapi:deploy?

Explanation:
When you deploy from a Salesforce DX project, the deployment semantics differ between the source-based flow and the metadata API flow. Force:source:deploy uses the source format and validates components in a way that allows those that pass validation to be deployed even if others fail. This enables partial progress within a single deployment attempt: some components can go through while others are left out due to validation errors. On the other hand, force:mdapi:deploy relies on the Metadata API, which typically treats a deployment as a single transaction. If any component in the package fails, the whole deployment is rolled back, and no changes are committed for that attempt (unless partial success is explicitly allowed, but the common behavior without forcing partial success is a full rollback). So the best match is that source-based deployments can progress with the components that validate, while MDAPI deployments revert the entire set if something goes wrong. This contrast in transactional behavior is what distinguishes the two commands.

When you deploy from a Salesforce DX project, the deployment semantics differ between the source-based flow and the metadata API flow. Force:source:deploy uses the source format and validates components in a way that allows those that pass validation to be deployed even if others fail. This enables partial progress within a single deployment attempt: some components can go through while others are left out due to validation errors.

On the other hand, force:mdapi:deploy relies on the Metadata API, which typically treats a deployment as a single transaction. If any component in the package fails, the whole deployment is rolled back, and no changes are committed for that attempt (unless partial success is explicitly allowed, but the common behavior without forcing partial success is a full rollback).

So the best match is that source-based deployments can progress with the components that validate, while MDAPI deployments revert the entire set if something goes wrong. This contrast in transactional behavior is what distinguishes the two commands.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy