Salesforce DX

Introduction to Salesforce DX

Introduction to Salesforce DX

Introduction to Salesforce DX

Salesforce DX stands for Salesforce Developer Experience.  It’s a new development paradigm that shifts the source of truth from the org to your version control system (VCS). It offers set of new tools which elevates :

1) Streamlined development Experience
2) Team Development and Collaboration
3)  Facilitates automated testing and continuous integration
4)  Promotes Agile by making it even more efficient.


Salesforce DX introduces a distinct type of Org termed a "Scratch Org". It is a short-term Salesforce environment that you can quickly create from the Developer Hub (Explained below) when starting a new project, a new feature branch, or a feature test. You can decide what metadata and configuration you want to be copied from the Developer Hub to your Scratch Org. Copying is not limited to metadata and Configuration you could easily migrate Actual Data from your Developer Hub to the scratch org.
Creating a Developer Hub

A developer hub is the org from which you can create short-lived Scratch Orgs. You can enable Developer Hub in any paid, but I would recommend signing up for a free Dev Hub to get familiar with the functionality. To create a free Developer Hub click on this link https://developer.salesforce.com/promotions/orgs/dx-signup

Once you have your Developer Hub, let us get familiar with the tools required to handle them.

Installing Command Line Interface (CLI)

Use the Salesforce CLI to control the full application life cycle of your Force.com apps. You can easily create environments for development and testing, synchronize source code between your orgs and Version Control System, and execute tests.

Download and install the CLI from  https://developer.salesforce.com/tools/sfdxcli


To check if the Command Line Interface is installed correctly open the command prompt and type sfdx and press enter. You would see a message similar to the one below



We are all set to login to the Developer Hub org using the CLI.

Type the below command to link your Developer Hub.
sfdx force:auth:web:login -d -a MyDevHub

wait for few seconds and this would open the Salesforce login page. Enter the credentials for the Dev Hub account you just created.  Click Allow on the screen promt and you are done. You could close this window and return to the CLI. 

In the above command -d is added to default this as the Developer Hub account. Dont use -d while registering other orgs. 
- a is added to set the alias so that in future you could refer this org with the alias intead of the credentials. 

To check the orgs linked in the CLI type 
sfdx force:org:list

To open the org from the CLI type:
sfdx force:org:open

In the next post we would talk about creating a scratch org from the Devloper Hub and how to Push the components to the scratch org using the CLI

link for the next post - http://www.worldofsalesforce.com/2017/11/creating-scratch-org-using-cli-Salesforce-DX.html

About Saurabh Dua

2 comments:

  1. Hi Saurabh. how you doing?

    I have performed the steps described above, but I did not understand the part in which I have to create a Developer Hub.

    I created the user sfdeveloper@sldeveloper.com according to the "Get Started with Salesforce DX" page request, but it was not possible to create a password for this user and could not log in.

    How should I proceed?


    Other point. When I run the SFDX command:

    sfdx force: auth: web: login -d -a sfdeveloper@sldeveloper.com

    the Salesforce login page is opened, but I still have no password for the user sfdeveloper@sldeveloper.com created on page:
    https://developer.salesforce.com/promotions/orgs/dx-signup


    Can you help me. Please.

    ReplyDelete
  2. hi ,
    For the DevHub Creation i have successfully created an account using URL "https://developer.salesforce.com/tools/sfdxcli". I could find that the URL for my dummy account is "https://uss-galatica-154716.lightning.force.com/lightning/n/Getting_Started" .

    Also When i Tried to access the devhub from this new account , i got error "grant type not supported"


    please help any one

    Thanks
    ancil

    ReplyDelete

Powered by Blogger.