Create a Scratch Org
Last updated
Last updated
Salesforce DX can be enabled for any Salesforce instance known as Developer Hub. One Developer Hub can have multiple Scratch Orgs. Scratch Orgs are temporary Salesforce org which can be created quickly and metadata can be deployed from source code management (SCM). This kind of Orgs can be used by developers to perform quick proof of concept or build and test packages. A developer can create as many numbers as Scratch Orgs and delete them for each specific Salesforce DX project.
Module registered in AutoRABIT (LEARN MORE)
To create a new Scratch Org, perform the below steps:
Hover your mouse over the Salesforce DX module and select the option: Scratch Org Management.
Click on Create Scratch Org.
In this section, you would be filling your scratch org details.
Note: When configuring your Scratch Org, be aware that certain objects may require associated profiles and dependency data. This requirement isn't always explicit, so it's important to review your objects and their dependencies thoroughly to ensure a seamless setup.
Select the Dev HUB name. This is the main Salesforce org that you and your team use to create and manage your scratch org. Also, give a name to the Scratch Org.
There are three ways of filling in the details for your scratch org:
Download the ScratchOrg DefinitionTemplate into your local machine, fill it, and upload them. The template will be created based on the information available in the file chosen
Let AutoRABIT create the Scratch Org with Default Values. This is done when you do not upload any definition file or fill in the scratch org fields manually. On navigating to the next section, a popup notification appears which asks for your confirmation to proceed further.
Fill in the Scratch Org fields Manually. For manually, you need to fill in the below details:
Select the Input Details section.
On the pop-up screen, enter a username to the scratch org. If the field is left blank, the username gets auto-generated. Kindly note that the username entered should be in the email address format.
Give a small description of the scratch org in the Description field.
Enter the Duration Days till the scratch org will be in the active state.
Fill in the Organization for which the scratch org will be used.
Select the Features and Preferences Enable/Disable associated with its Scratch Org. For multiple selections, hold down the CTRL key and click on it.
Fill in the Admin Email, Country, and the Language as desired.
Select the Edition i.e., Developer, Group, Enterprise, etc., from the drop-down box. This field is also optional.
Enter the Wait Time (Minutes) to create the scratch org. The default wait time is 6 minutes, but you can set this value from 1 minute to a maximum of 15 minutes.
Click NEXT.
This section is all about choosing the right deployment source; it can be from your Salesforce Org, Version Control, or from an existing module that you have created in AutoRABIT. To create a new module, please follow the steps mentioned HERE.
Deployment via Salesforce Org
Choose Deployment From as Salesforce Org.
The Metadata Types field allows you to deploy either the entire Salesforce Org or Full Profiles or Permission Sets.
Full Profiles will fetch all the profiles available in the selected Salesforce Org
Full Permission Sets will fetch all the permission sets from your selected Salesforce Org
All will fetch all the metadata types available in your Salesforce org
Select your Source Org.
Choose the Deployment Method:
Selective Deployment: Selective deployment will allow you to choose and deploy the selected metadata types from your Salesforce org
Full Deployment: All the metadata types will be deployed
Click Retrieve Metadata. This retrieves a list of all metadata types from your selected source org, allowing you to choose which members to be included in the deployment. If necessary, you can use the search filter to find your metadata types faster.
Click Proceed > Proceed to take you to the next screen where you can apply filters for your deployment being initiated.
Different Deployment Filters:
Ignore warnings: When this filter is checked, metadata types that trigger warnings during the retrieval process will not cause the deployment to fail, and AutoRABIT will deploy all other metadata types as possible.
Validate only: Checking this option will validate and save the deployment label without actually executing the deployment. The label can then be used later for a Quick Deploy if the target org is a production environment against which the validation was done.
Take backup: This option creates a backup of the original state of the metadata to which you can revert if the deployment fails or has other functional issues.
Ignore missing visibility settings (profiles): With this option, differences in visibility settings between the source and destination orgs will not cause the deployment to fail. AutoRABIT will compare the source and destination orgs and keep only the settings that are common between both orgs.
Remove Login IP Ranges: This option will remove IP ranges from your profile while deploying.
Remove System and User Permissions: Remove the user's permission from your profile while deploying.
Do not include Destructive members: Select this checkbox if you have configured certain metadata types to skip while deploying. You can configure such metadata types under the Admin > Salesforce Org Management page.
Do not include Skip members: Select this checkbox if you have configured certain metadata types to skip while deploying under the My Account page.
Ignore installed components: When selected, AutoRABIT will scan for the components that are deployed, and if there are any managed package components located in the target org, these components will be excluded from the metadata.zip files while the remaining components will get deployed.
Fetch Wavexmd components (applicable only if WaveDashboard's metadata type is chosen for deployment): Upon selection, this checkbox will allow you to select the respective wavexmd files belonging to the wave dashboard metadata type and deploy them via selective deployment to another Salesforce Org. This checkbox will be hidden if the 'WaveDashboard' metadata type or its corresponding members are not picked.
Important Note: Standard fields are not supported for Ignore Missing Visible Settings.
Choose the Static Code Analysis tool to detect bugs, code smells, and security vulnerabilities before the deployment begins.
If you have created the SEARCH and SUBSTITUTE rules to define custom find and substitute rules that AutoRABIT applies whenever you commit and deploy files from one Sandbox to another Sandbox, one Sandbox to Version Control, or vice-versa, such rule can be found here.
Under Deployment Notes, specify the reason for the deployment and what has changed across your Salesforce Org.
Click Next. The user will be redirected to the Deployment Summary page where he can view the components one final time before getting deployed.
Deployment via Version Control
Choose Deployment From as Version Control.
In the Version Control, Repository, and Branch fields, choose the appropriate sources.
Select the Metadata Types.
Choose the Deployment Method and click on the Retrieve Metadata button. The remaining steps are already discussed in the previous section (Steps 5-11).
Deployment via Module
This section is all about deployment using the module available in your AutoRABIT application.
Different options get auto-populated based on the Module selected:
Load Dataset from <Module Name> for the Scratch org: This option will reflect only if the user has selected Create Data set from <Source Org> for the module under the Publish section at the time of creating a module. This option upon selection will add the dataset available in the selected module to the scratch org
Include all the dependent packages: All the dependent packages associated with the selected Module will get fetched. The user can either include all the dependency packages to the scratch org by selecting the checkbox as shown below or not include it.
Click Show Members to view the list of metadata types available in the selected module.
Click Next to go to the next section i.e., Assign Branch and ALM.
Assign Branch
Select the Version Control type, Repository, and its respective Branch.
Create Branch callout button is useful in creating a fresh branch assigning to the Scratch Org being created.
Assign User Story
Select the ALM work item to update the ALM work item status. Once the changes are committed to the version control system, the status of the ALM work item is updated and reflected in your ALM system.
Select the ALM Type. Currently, AutoRABIT supports ALM types like JIRA, IBMRTC, Version One, CA Rally, and Azure DevOps.
Select the ALM Label.
Select the Project and the Sprint for which the commit is planned.
Select the Work Item.
Click Next.
In this section assign the module permission to your users. An email notification gets triggered to each user with scratch org details.
You will be redirected to the Scratch Org Management homepage which will show you the progress of the scratch org recently created.
Scratch Org Summary: Click on the Scratch Org link to view the detailed summary of your Scratch Org
View Log: View the log information of the Scratch Org
Deployment Status and Report: Status of the deployment i.e., success, failure, succeeded partial, or is timed-out along with the Deployment report
Load Data: This section gives info about sample data added to the scratch org or not.
Scratch Org Status: Scratch org status i.e., inactive or inactive state.
Manage:
Launch Scratch Org: Launch the Scratch Org in the new tab based on the URL instance. Make sure the pop-up is enabled in your browser which may sometimes strict the opening of another tab while using our application.
Manage Scratch org permissions: Manage the module permission that is assigned to the users. An email notification gets triggered to each user with scratch org details when modified.
Actions:
Delete a Scratch Org: Deletes a Scratch Org. This process cannot be undone!!
Edit ALM and Branch: Modify or update the ALM and Version Control Repository, Branch details.