Friday 14 July 2017

Get Started with Setup of SalesforceDX, using Salesforce DX CLI #sfdx

Summer ’17 contains a beta release of Salesforce DX, Salesforce DX provides you with an integrated, end-to-end lifecycle designed for high-performance agile development. And best of all, we've built it to be open and flexible so you can build together with tools you love.

So here we are going to start the setup of SalesforceDX

Step 1 : Create SalesforceDX trial org or Salesforce Dev Hub Trial Org, here is the link

Step 2 : Enable the Dev hub in your org, perform below steps

Step 3 : Create a SalesforceDX user or you can use System admin user also, if your user is not a System admin, then create a permission set and assign the permission set to the salesforceDX user, permission set will have below permissions

Step 4 : Install SalesforceDX CLI

here is the link to download
After downloading the SalesforceDX CLI, install it.

After installing, it will by itself uninstall the git and re-install it again.

Step 5 : Use the sfdx-simple git repo, 

here is the link , we will get this repo in our system first, so clone it, follow below steps
Our first goal is to set up a developer project which we'll use to modify our application. It starts by cloning the repository. Use the command

             git clone

Then, open the directory.

             cd sfdx-simple

Step 6 : Login to SalesofrceDX

Run this command, it will install the NodeJS by itself as it requires NodeJs, and by this command we are login in to SalesforceDX org, and authorizing it.

So after this login window will open, where you need to put your salesforceDX credentials, and authorize, after that you can close the window

Step 7 : Now we will create a scratch org,

The scratch org is also created through the CLI, using a config file.
Run below command


              sfdx force:org:create -s -f config/project-scratch-def.json

So if you logged in the SalesforceDX org, you can see the data in Scratch org info. You are done as you've successfully created the scratch org.

Now, Push the repo metadata to scratch


       sfdx force:source:push

In the same way you can perform multiple actions using SalesforceDX CLI
to see more commands, enter


     $ sfdx force --help

Below are some commands you can use to create the metadata

To create apex class

        sfdx force:apex:class:create -n myclass

There are many things that we can do using SalesforceDX and SalesforceDX CLI, like continuos integration, source control and many more, soon will post about Salesofrce IDE 2, which can be used as of the important tool to leverage the functionality of SalesforceDX.

Here are some important links

SalesforceDX cli
SalesforceDX Developer Guide (Beta)
SalesforceDX CLI Configuration and tips
Sample Source in GitHub

thank you.

No comments:

Post a Comment