Salesforce scratch org management is a process of the Salesforce platform that allows developers to create and manage isolated Salesforce environments, called scratch orgs, for development and testing purposes.
They are temporary, disposable environments that can be created on demand and can be customized to match the specific needs of a development project.
In the past, Salesforce development was typically carried out in sandboxes. Changes were moved using change sets or other metadata deployment tools.
Salesforce has however introduced a new development model, which includes scratch orgs. Some users are thus unsure about if they should be doing their development work in a sandbox or a scratch org.
To determine which one should be used when, it is crucial to know the differences between the two.
When it comes to scratch orgs, they are typically managed using a combination of command line Interface (CLI) commands and metadata configuration files. For continuous integration and delivery and version control, they are enforced by SFDX.
Here are the main steps involved in managing scratch orgs:
Using the CLI, you can create a new scratch org and configure it with specific settings, features, and data.
Once the scratch org is created, you can use it to develop your Salesforce code, such as creating or modifying objects, fields, workflows, and other metadata.
After making changes to your local codebase, you can use the CLI to push the changes to the scratch org. This ensures that the scratch org reflects the latest changes.
With the changes pushed to the scratch org, you can test and validate the changes by running automated tests, manual tests, or using other validation methods.
Once the scratch org has served its purpose, you can delete it and create a new one. This allows you to start fresh and ensures that you are always working with a clean development environment.
In essence, managing scratch orgs from a command-line is like playing Tetris with command-line blocks, it's fun but can get messy pretty quickly.
With that being said, managing Salesforce scratch orgs can present several challenges:
However, what if there's a better way to manage your scratch orgs?
With Hutte, a web UI to SFDX that enables visual Salesforce version control, Salesforce scratch org management becomes a labor-saving development workflow.
Hutte enables developers to easily create, modify, and delete scratch orgs as needed.
Hutte is truly one of the best tools that we use. Product owners, Salesforce solution architects, business analysts — anyone on our team can easily and visually accomplish the tasks that would otherwise take a lot of clicks, time, and coding.
With that being said, let’s go through how to manage scratch orgs using Hutte.
You can create scratch orgs that can be accessed together as a team. Various users can create their scratch orgs using the “New scratch org” button.
You can choose a Git branch from which you want to create your environment, and you can name it.
Without Hutte, you need to rely solely on CLI. With Hutte, you can:
If a developer has executed new features and submitted it to Git, instead of them manually having to tell the team that they have provisioned an environment, the team can simply view it on the scratch orgs dashboard.
They will tell the team which branch they added the features to. You can then find the branches by “New scratch orgs.” From there, you can create a scratch org from that branch. It will appear in your list of scratch orgs.
Hutte essentially empowers users to easily manage and pick their own environments.
Hutte has a pool of orgs pre-created for you, so you don't need to wait, as you can spin them up visually. Picking a scratch org from the pool speeds up the process even further when you need an environment from the latest state of your source.
You can “Take from pool,” enter the name of the pool you want to claim, and it will appear in your pool.
You can dimensionate your pool by going to the “Settings.” As an addition, you can decide how big the pool is and what the duration of the pool will be.
Without Hutte, you need to follow these steps for sandboxes:
There is also a “Features” tab that enables you to collaborate on changes within sandboxes, like with scratch orgs.
If you use Jira, there will be a work item for it. Hutte’s Jira plugin will then find scratch orgs that reference the same name as your work item (or issue).
You, as a product manager, can then leave a comment to the developer that worked on the scratch org you selected. This enables collaboration without any interference or overriding of work already done by a developer.
This plugin is still very new, so watch this space for more updates.
Even though scratch orgs are intended to be workspaces where individuals can explore and test features in isolation, when you work together, you can conquer challenges. Obstacles like configuration management, data management, and juggling multiple scratch orgs become more streamlined.
So, consider utilizing Hutte, work together, and watch your Salesforce development efforts skyrocket with better outcomes and top-notch code quality.