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.
Here are the experts we collaborated with to bring you unique insights.
They are temporary, disposable environments that can be created on demand and customized to match a development project's specific needs.
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 knowing the differences between them is crucial.
Scratch orgs are typically managed using command-line Interface (CLI) commands and metadata configuration files. SFDX enforces continuous integration, delivery, and version control.
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, 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.
Once the changes are pushed to the scratch org, you can test and validate them by running automated tests, manual tests, or 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 you always work in a clean development environment.
In essence, managing scratch orgs from the command line is like playing Tetris with command-line blocks; it's fun but can get messy 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. Users can create scratch orgs using the “New scratch org” button.
You can choose a Git branch from which you want to create your environment and 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 manage and pick their own environments easily.
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 “Settings.” You can also decide its size and length.
Without Hutte, you need to follow these steps for sandboxes:
There is also a “Features” tab that enables collaboration on changes within sandboxes, such as 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).
As a product manager, you can then leave a comment for the developer who 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.