0% found this document useful (0 votes)
16 views3 pages

Salesforce CLI and Scratch Org Guide

The document provides a step-by-step guide for using the Salesforce CLI to manage development tasks, including authorizing a development org, creating an SFDX project, and managing Scratch Orgs. It details commands for importing, exporting, and creating data, as well as deleting Scratch Orgs and logging into a Sandbox. The instructions are aimed at developers working with Salesforce environments and include specific command line inputs for various tasks.

Uploaded by

s.dattacemk
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Salesforce CLI and Scratch Org Guide

The document provides a step-by-step guide for using the Salesforce CLI to manage development tasks, including authorizing a development org, creating an SFDX project, and managing Scratch Orgs. It details commands for importing, exporting, and creating data, as well as deleting Scratch Orgs and logging into a Sandbox. The instructions are aimed at developers working with Salesforce environments and include specific command line inputs for various tasks.

Uploaded by

s.dattacemk
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Table of Contents

Start with CLI...............................................................................................................................................2


Authorize dev org from SLI......................................................................................................................2
Create sfdx project..................................................................................................................................2
GIT clone, checkout in your own directory..............................................................................................2
Create Scratch Org...................................................................................................................................2
Import/export/create Data......................................................................................................................2
Delete Scratch Org...................................................................................................................................3
login Sandbox..........................................................................................................................................3
Start with CLI
Authorize dev org from SLI
Type in from command prompt ‘sfdx auth:web:login -d -a DevHub’

Create sfdx project


sfdx force:project:create -n geolocation

GIT clone, checkout in your own directory


cd my_sfdx_project

git clone [Link]

git checkout -b my_branch

Create Scratch Org


sfdx force:org:create -s -f config/[Link] -a dreamhouse-org

Provide permission set:

sfdx force:user:permset:assign -n Dreamhouse

Import/export/create Data

Import from json

sfdx force:data:tree:import --plan data/[Link]

Create account

sfdx force:data:record:create -s Account -v "Name='Marriott Marquis' BillingStreet='780 Mission St'


BillingCity='San Francisco' BillingState='CA' BillingPostalCode='94103' Phone='(415) 896-1600'
Website='[Link]'"

Export into json folder:


sfdx force:data:tree:export -q "SELECT Name, BillingStreet, BillingCity, BillingState, BillingPostalCode,
Phone, Website FROM Account WHERE BillingStreet != NULL AND BillingCity != NULL and BillingState !=
NULL" -d ./data

Delete Scratch Org


sfdx force:org:delete

Open Scratch Org


sfdx force:org:open -u GeoAppScratch

login Sandbox
sfdx auth:web:login -r [Link] -a FullSandbox

sfdx auth:web:login -r [Link] -a DevSandbox

Start with VS

You might also like