Salesforce DX was announced at Dreamforce 2016, since then it has the entire Salesforce developer community excited. It is a welcome change to the end to end lifecycle of agile projects. Salesforce DX lets the developers continue using familiar tools for development, deployment, CI along with new APIs, a powerful new command line interface (CLI).
Before we begin, signup for a free trial org for Salesforce dx Beta.
Once you have verified the account and logged in to the Salesforce dx org, follow the following steps to enable the Dev hub (If you are using the trial org then Dev hub is enabled by default).
- Go to Setup, type “Dev Hub” in the quick find.
- Select Dev Hub and click Enable to enable Dev Hub.
System Administrator gets the access to the Dev Hub by default, to grant access to Dev Hub to non-admin users, we need a Salesforce dx permission set.
Follow the following steps to create the Permission set to enable Salesforce DX for non-admin users.
- Create a new Permission set.
- Enable the following permissions for the objects
- Object Settings -> Scratch Org Info -> Read, Create, and Delete
- Object Settings -> Active Scratch Org -> Read and Delete
- Object Settings -> Namespace Registry -> Read, Create, and Delete
- Save and assign the permission set to standard users to enable Dev Hub.
Salesforce DX provides the following features to the developers to enhance the developer experience:
- A powerful command-line interface (CLI) removes the complexity of working with your Salesforce org for development, continuous integration, and delivery.
- You can use any IDE or text editor you want with the CLI and externalized source.
- Update the Force.com IDE plugin built for DX if you prefer using Eclipse.
- Instead of the org, your version control system is the source of truth.
- The most important feature: Scratch Orgs. A flexible and configurable environment which helps build apps faster.
What IS a scratch Org?
The scratch org is a source-driven and disposable deployment of Salesforce code and metadata. Scratch org acts as a temporary Salesforce sandbox/org which can be created and destroyed easily. Using scratch org the developers can emulate different Salesforce editions with different features and preferences. It can be used for a quick POC, build a module from scratch or basically any other task which is performed in a regular sandbox. Scratch orgs can be enabled from the Developer Hub.
A Developer Hub can have maximum 25 active scratch orgs at a time.
In the next post, I’ll share the a-z(almost) of working with Salesforce DX.