Scratch Org in Salesforce

Scratch Org feature in Salesforce helps Source Driven Development.

The scratch org is a source-driven and disposable deployment of Salesforce code and metadata components. This feature is made for developers and for deployments automation (CI/CD). A scratch org is fully configurable, allowing developers to emulate/simulate different Salesforce editions with different features and preferences.

To create a Scratch Org using VS Code:

To push changes to the Scratch Org:

sfdx force:source:push --targetusername <Scratch Org Username>

Scratch Org Expiry:

When you create a Salesforce Scratch Org, you an specify the expiry for it. Specify the scratch org’s duration which indicates when the scratch org expires (in days).

sfdx force:org:create -f config/project-scratch-def.json --durationdays 30

To build a sample scratch org, check

Additional information –

Trailhead Resource –

Leave a Reply