Day 8: Create Scratch Orgs using an Org’s Shape

By

2 minutes de lecture

On the 8th day of Christmas we are going to speak about Salesforce Org’s Shape and I bring to you a great new tip from our #TexeiAdventCalendar.

Creating a scratch org with the same features and settings as your production org is not an easy task. To simplify our lives, Salesforce introduces the Org’s Shape which allows you to create a scratch org similar to your production org!

The Org’s Shape refers to features, settings, limits, and licenses. These characteristics will be cloned to your scratch org thanks to this Beta feature.

Salesforce Org’s Shape: how does it work?

To enable this option, you need to follow a few steps:

  • From setup, search for the Org Shape option in the Quick Find Box and select it.
  • Enable Org Shape for Scratch Orgs.
  • If the source org is different from the Dev Hub, enter the 15-character Id of your Dev Hub. You can add up to 50 Dev Hub Ids separated by a line.
Salesforce Org’s Shape
Setup-Org Shape
  • Create an Org Shape, this requires a few SFDX commands that you can find here.
  • Create a scratch org definition file. Instead of indicating the edition you have to indicate the sourceOrg (use the 15-character Id of the org whose shape you created). If you want, you can also add more functionalities that are not necessarily available in the source org. See the example below.
Scratch org definition file example
  • Create a scratch org.

And voilà! You have a brand new scratch org with much more similarities to your source org.

Conclusion

This is a great way to build a more “realistic” development environment. It is simple to keep your scratch orgs updated. You can do this by just creating a new Salesforce Org’s Shape anytime you need to.

You can learn more about this feature here.

Want to continue learning? Check out our next article Salesforce Custom Notifications

 

Read more posts

Enforce code standards with PMD

Developers working on a project usually set coding rules to have a standardized codebase. It is an important piece of the code maintainability, and it can be very easy …
March 2023
Advices
Scratch orgs

Uncovering Salesforce Settings: A Step-by-Step Guide for Scratch Orgs

Today, it’s pretty easy to build your Scratch Org definition file when you know what Settings you want to activate, as they are mapped with the same setting names …
February 2023
Advices
Business Analyst

Core qualities of a Business Analyst?

A common definition we are used to hear is that being a Business Analyst means to have a combination of both hard skills and soft skills. What does a …
June 2022
Advices
Image d'illustration d'une employée travaillant sur un ordinateur portable

Process builder and workflow make way to Flows (½)

Overview “If you can do it with a Workflow, then do it with a Process Builder, because everything a Workflow does, a Process Builder does it better”. If you …
March 2022
Advices

Day 22 : Salesforce new “Migrate To Flow tool” in Spring 22

As most of you already know, the workflow rules and process builders are planned to be retired in 2023 (no precise date defined so far). Today, I’m going to …
December 2021
Advices

Day 18 : Fake callout responses for test classes !

Hello everybody ! Today let’s talk about Apex tests classes in Salesforce. Everyone loves a good test class, and Salesforce makes it official by requiring to have a minimum …
December 2021
Advices