Scratch Orgs

Updated 1 month ago by Copado Solutions

Scratch Orgs

A scratch org is a source-driven and disposable deployment of Salesforce code and metadata. A scratch org is fully configurable, allowing developers to emulate different Salesforce editions with different features and preferences. You can share the scratch org configuration file with other team members, so you all have the same basic org in which to do your development.

      Salesforce-

Benefits of Scratch Orgs

  • Perfect for source control driven development.
  • Quick creation.
  • Clean and isolated work & test environment.
  • Reduces the number of sandbox refreshes.
  • Ideal to test new Salesforce features.
  • Ideal for employee training.

In Copado DX, scratch orgs can be created for 5 main different reasons:

  1. Code and Metadata development for developers and admins.
  2. A feature, module or a release testing.
  3. To patch an older version of your application.
  4. As a training org or review application.
  5. As a stand-alone org for feature or preference investigations.

There are 3 different types of scratch orgs in Copado DX to fulfill the requirements developers or admins are assigned. 

  1. Scratch Org: This type of scratch org is flexible. Whenever a scratch org is created for a user story, a feature development or investigation, Copado DX will automatically assign the scratch org's scratch org type.
  2. Scratch Org - Test Only: As you can infer from its name, this type of scratch orgs can be used only for testing purposes. Therefore, this type of orgs cannot be a part of any deployment flow or any user story. You cannot commit any changes from this type of org either.
  3. Scratch Org - Patch: This type of scratch orgs can only be used as a patch org, so from these orgs developers cannot commit any new code or metadata, they can only work on existing metadata. By using patch orgs developers can submit hotfixes for the current version of an app or an artifact. They can also do retroactive changes for an old version of an app or an artifact.

Creating a Scratch Org

In order to create a scratch org, you need to define what you want to achieve. With that definition, you can easily decide which Salesforce edition you need, which country and language you should select or in which deployment flow you will include the scratch org. However, in order to enable the Salesforce features that you need or which org preferences you need to enable or disable, you need to have a deep knowledge and understanding of those features and preferences. 

Copado DX offers you org definition templates from which developers and admins can benefit to overcome this troublesome situation.

An org definition template holds all the configurations, features and org preferences to be enabled for a scratch org. Release managers, project managers or system administrators can create these templates and developers and admins can just select the template to create a scratch org.

Similarly to org definition templates, Copado DX also offers project templates where a set of Git or unmanaged package artifacts can be stored for certain use cases such as app development, app or module testing, app or module training, etc.

For more details about templates please check out the article DX Planning Operations.

Once you have your templates ready, there are two pages from where you can create a scratch org, Copado DX Panel or user story's scratch org wizard. 

In the Copado DX Panel you can create scratch org from:

The scratch org wizard is only available from the user story layout.


How did we do?