Thursday, 4 January 2018

Salesforce DX | Change a Password for a Scratch Org in Salesforce

Change a Password for a Scratch Org User

In our last post we learn about how to install Salesforce DX and how to create Scratch org with salesforce DX,

What is Scratch Org ?

A Scratch org is a dedicated , configurable and short term Salesforce org that you can quickly spin - up when starting a new project , new feature branch and feature Test.

Create Password for Scratch org

When we create a scratch org using command line it does not show password. But if you need  password for your scratch org then try below command.

Step 1) Generate password

sfdx force:user:password:generate -u <Alise_Org_Name>

sfdx force:user:password:generate -u MyFirstScratch

Step 2) To see the password again.

sfdx force:org:display -u MyFirstScratch

Please share your feedback and comment

Amit Chaudhary

Tuesday, 2 January 2018

Salesforce DX | How to Setup Salesforce DX | Creating Scratch Org

How To Setup Salesforce DX

Step 1) Create Developer Hub Trail Account


NOTE:- This account is for 30 days only

Step 2) Install Command Line Interface

    1) Download the CLI from below link and install that.

    2)  In a command window, enter sfdx

    Then you will see a window like below. Then wait for installation

Then you can open Command prompt and check all is well or not

Step 3) Setup Dev Hub and Set Alias

    1) Login on Dev Hub

    Execute below command in command prompt to authorize the Dev hub with web login flow  

    sfdx force:auth:web:login -d -a DEVHUB
       -d to set Default org
       -a to set alias for the org

    Then it will take you to wed browser to login. Then login with your salesforce Dx Account

    After login you will get below screen.

    After that you can login with alise Name DEVHUB any time below command.

    sfdx force:org:open -u DEVHUB

    If you want to login in sandbox you can try below command as well

    sfdx force:auth:web:login -r -a FullSandbox

    -a is used for alias

    With that if in future you want to login in sandbox you can login like below

    sfdx force:org:open -u FullSandbox

    if you want to see all org then try below command

    sfdx force:org:list

Step 4) Create Scratch Org:-

    1) Create Project

    Execute below command

   sfdx force:project:create -n c:\Amit_Salesforce_DX\MyProject

    After Above command it will create a folder like below

Configures the source that this local project manages
Determines the configuration of a scratch org, including which features and preferences define its org shape
This folder will contain project

    2) Create Scratch Org

    Go to project location then create scratch org.

    Then Execute below command to create Scratch org

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

    -s used for scratch org
    -f path the project scratch org confirgutaion File.

    Once Scratch org will ready then you can also see same org in salesforce as well.

    :) Now your Scratch org is ready. Start your Development in scratch org.

If you you looking for Video and PPT. Check here in Salesforce Apex Hours.

Please share your feedback and comment

Amit Chaudhary