Giter Club home page Giter Club logo

salesforcedx-cheatsheet's Introduction

Salesforce DX Cheatsheet

A quick reference to common SFDX commands

Contents



Authentication

Connect Salesforce DX to an Org (e.g. DevHub, Sandbox, Production)

sfdx force:auth:web:login -d -a <Name of Org to be Authenticated>

Generate a Password for the Org User

sfdx force:user:password:generate -u <Org Name>

Scratch Org Management

Create a Blank SFDX Project

sfdx force:project:create -n <Project Name>

Create a Scratch Org

cd <Project Name>
sfdx force:org:create -f config/project-scratch-def.json -a <Scratch Org Name> -s -d 7

View a list of active Orgs

sfdx force:org:list

View a list of all Orgs

sfdx force:org:list --all

Remove all local inactive/expired Orgs

sfdx force:org:list --clean

Set a Scratch Org as the Default

sfdx force:config:set defaultusername=<Org Name>

Meta Data Management

Push source meta data to an Org

sfdx force:source:push -u <Org Name>

Pull source meta data from an Org

sfdx force:source:pull -u <Org Name>

Copy source meta data to an Org

sfdx force:source:push -u <Org Name>

Pull changes from one Org to another

sfdx force:source:pull -u <Org Name 1>
sfdx force:source:push -u <Org Name 2>

Org Security

Grant permission set to default user

sfdx force:user:permset:assign -n <Permission Set Name> -u <Org Name>

Test Data Management

Exporting data from an Org to a file

sfdx force:data:tree:export -q "SELECT Name, Custom__c FROM Account WHERE Name != NULL AND Custom__c != NULL" -d ./data -u 

Importing data to an Org from a single file (e.g. Account)

sfdx force:data:tree:import -f data/Account.json -u <Org Name>

Importing data to an Org from multiple files using a plan

sfdx force:data:tree:import -p data/<plan file>.json -u <Org Name>

Test and Deploy

Convert source meta data to Meta Data API Package

mkdir <Output Directory>
sfdx force:source:convert -d <Output Directory>

Check and Run All Local Tests

sfdx force:mdapi:deploy -w 10 -l RunLocalTests -d <Output Directory> -u <Org Name> -c

Run All Local Tests and Deploy

sfdx force:mdapi:deploy -w 10 -l RunLocalTests -d <Output Directory> -u <Org Name>

Check and Run All Tests in Org

sfdx force:mdapi:deploy -w 10 -l RunAllTestsInOrg -d <Output Directory> -u <Org Name> -c

Run All Tests in Org and Deploy

sfdx force:mdapi:deploy -w 10 -l RunAllTestsInOrg -d <Output Directory> -u <Org Name>

salesforcedx-cheatsheet's People

Contributors

gurenax avatar

Watchers

James Cloos avatar ddjadel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.