Salesforce DX

Creating Scratch org using CLI - Salesforce DX

Creating Scratch org using CLI - Salesforce DX

Creating Scratch org using CLI - Salesforce DX

To know about scratch Orgs and the prerequisites required to create Scratch org refer to the previous post-

In this post, we will try to create a scratch org and push configuration and Metadata to it using CLI.

Let's start by creating a project on our local machine. Open the command prompt and type the below command.

mkdir my_WOS_project  
cd my_WOS_project

The above command will create a folder called my_WOS_project and change the active directory to it.

Now we will clone a project from the GIT repository. 
git clone

now lets change directory to ScratchOrgDemo
cd ScratchOrgDemo

now let's create scratch org and name it as MyOrg using the below command
sfdx force:org:create -s -f config/project-scratch-def.json -a "MyOrg "

after few seconds you would see the message containing the scratch org Id 
and username.

To open the newly created scratch org using CLI type
sfdx force:org:open

lastly, we will push the repository we cloned to the scratch org using CLI
Simply type
sfdx force:source:push

once the metadata is pushed to the org, open the org again to see the changes.
A classic app called Scratch org demo would be present with the visualforce tab . 
See video for step by step instructions.

About Saurabh Dua


  1. Hi Saurabh,

    when I try to create the scratch org by the following command sfdx force:org:create -s -f config/project-scratch-def.json -a "MyOrg "
    I get the following error
    You do not have access to the [ScratchOrgInfo] object.....
    Can you help Me solve the problem.... I have cloned the repository

  2. You wont believe you made a miracle in my life, I was literally struggling to fix Salesforce DX on my system for last 2 weeks , this simple document of yours has literally fixed my issue

    saying Thank you would be very small thing ,I just cant express my happiness

    Thank you so muchhhhhhhhhhhhhhhhhhhhhhhhhh :)))))))))))))000000

  3. Hi On open the scracth org after putting code, it throws this error: This page has an error. You might just need to refresh it.
    [NoErrorObjectAvailable] Expected identifier
    throws at


Note: only a member of this blog may post a comment.

Powered by Blogger.