Saturday, December 12, 2020

What is scratch org in Salesforce?

 In this blog post we will see  "What is scratch org in Salesforce?" and "How to create a scratch org?"

Scratch org is disposable Salesforce org used for development and testing.

Scratch org can be created for a maximum of 30 days after which scratch org gets deactivated. Default duration for Scratch org is 7 days. "config" file as shown in the below image contains the Scratch org definition.


What is Scratch org?


Let see how we can create a scratch org.


STEP 1: Go to Visual code studio.

STEP 2: Authorize a dev hub as shown in below post.

How to authorize an org using command SFDX: Authorize a Dev Hub?

STEP 3: Now press CTRL+SHIFT+P and search for "Create a Default Scratch org" and click on it and select the file as shown in the below images.


Create a Default Scratch org in Salesforce
What is scratch org in Salesforce?


Specify the name and the days after which the scratch org will expire, after providing the necessary information we will now see that the scratch org is getting created.

What is scratch org in Salesforce?


How to create scratch org in Salesforce?

How to create scratch org in Salesforce?


You can now check the created scratch org in authorized dev hub under "Active Scratch Org" as shown below.

What is scratch org in Salesforce?


After the Scratch org is created successfully press CTRL+SHIFT+P  and type "SFDX:Open Default Org". It will open the Scratch org in new console.

Our "Dev Hub" org edition determines how many scratch orgs we can create daily, and how many can be active at a given point. 

No comments:

Post a Comment