This document summarizes a presentation about using Salesforce DX (SFDX) for administrators. It discusses how SFDX can reduce the number of clicks needed to perform common admin tasks. The presentation covers what admins need to know about SFDX, including commands, scratch orgs, and connecting to orgs. It provides examples of using SFDX to assign permission sets, upload data, and run tests. It introduces the idea of "DX instant recipes" to easily accomplish tasks and shares a link to an open source SFDX command line cookbook repository on GitHub.
Your admin toolbelt is not complete without Salesforce DX
1. Your Admin Toolbelt is not complete
without Salesforce DX
Christian Szandor Knapp
Lead Salesforce Developer * appero
sz@appero.com
@ch_sz_knapp
Learn to Leverage and Love the aDmin eXperience
Daniel Stange
Technical Architect * DIA die.interaktiven
daniel.stange@die-interaktiven.de
@stangomat
2. Agenda
1) Let’s talk shop
2) DX for admins I
• What you need to know and don’t need to know
3) Interlude:
• Installation
• The Structure of a DX Command
• The most important DX parameter
4) DX for admins II
• What you need to know and don’t need to know
5) How to instantly make your life easier with DX and DX instant recipes
14. What you need to know - and what not
● dx commands
● scratch orgs
● git
● how to code
● open a command line
● copy
● paste
● navigate to files/folders
16. Interlude: First Steps - Setup
There’s no way around and you can learn this from Trailhead:
https://trailhead.salesforce.com/content/learn/projects/quick-start-salesforce-dx
Install from
https://developer.salesforce.com/tools/sfdxcli
Connect to Production (Dev Hub)
sfdx force:auth:web:login
--setdefaultdevhubusername
--setalias PRODUCTION
Open your org
sfdx force:org:open -u PRODUCTION
17. DX Command structure
Examples
sfdx force:org:open --targetusername PRODUCTION
sfdx force:org:open -a PRODUCTION
sfdx topic:subtopic:subsubtopic
--parameter1 A --parameter2 B
22. DX works with Scratch Orgs only
… Wrong. Since Winter 19 it’s become more
intuitive but never has been a real issue.
Common Misconceptions
DX is about source control and versioning
… Yes, ideally, but no one is forcing you.
DX is for developers only
… No. They might have a bit of a head start,
though.
DX is brand new
… the term is, the CLI isn’t and neither is most
functionality. Scratch Orgs are a new thing
indeed.
23. A Word About User Interfaces
Amazon’s Alexa is a user interface
The Salesforce UI is a user interface
The DX CLI is a user interface
The Command Line is a user interface
All User Interfaces enable
direct interaction with an application
without pestering you with implementation
details
29. Try, Learn, Improve… and have patience
● Learning how to cook takes time and experience
Fear not, cookbooks are here to help:
● Find a recipe that looks delicious
● Cook it
● Learn and adapt for next time
Try out things in your test org - you’ll either pass or fail, but you’ll always learn
Remember: --help
Knowledge
Experience
Tooling
dish
completed
without any mess
30. Recipe 1 - Build your admin keychain
Steps:
Copy & Paste once
sfdx force:auth:web:login -a FancyAliasName
Copy & Paste anytime
sfdx force:org:open -u FancyAliasName
Notes:
-a is a shorthand for --setalias
(set an alias for a username)
-u is a shorthand for --targetusername
(the username of the org that the command targets)
31. Recipe 2 - Permissioning the Smart Way
Steps:
Copy & Paste
sfdx force:user:permset:assign -u FancyAliasName -n
PermissionSetName -o 'user1@company.com,
user2@company.com'
Notes:
-n is a shorthand for --permsetname
-o is a shorthand for --onbehalfof
32. Recipe 3a - Excel All the Things Downwards
Steps:
Prepare a SOQL Query. Ours is:
SELECT Name FROM Account WHERE AnnualRevenue > 500000’
Copy & Paste
sfdx force:data:soql:query -q "SELECT Name FROM Account
WHERE AnnualRevenue > 500000" -r csv -u FancyAliasName >
SimpleAccountExport.csv
Notes:
-r is a shorthand for --resultformat ( can be: human, json, csv)
-q is a shorthand for --query
> at the end is a terminal shortcut to write output of command to file (win/mac/linux)
33. Recipe 3b - Excel All the Things Upwards
Steps:
Copy & Paste
sfdx force:data:bulk:upsert -u FancyAliasName -s Lead -f
MyTradeFairLeads.csv -i Email
Notes:
-s is a shorthand for --sobjectype
-f is a shorthand for --csvfile
-i is a shorthand for --externalid
34. Recipe 4 - Declarative Changes Safety Net
Steps:
Copy & Paste
sfdx force:apex:test:run -l RunLocalTests ⇒ note the results
Activate your changes
Copy & Paste again
sfdx force:apex:test:run -l RunLocalTests
Notes:
-l is a shorthand for --testlevel (testlevel can be: RunAllTestsInOrg,
RunSpecifiedTests)
35. Now that you’ve had a taste…
Here’s our Open Source Cookbook
Peter Chittum has started a Command Line Cookbook… it’s very much work in progress
https://github.com/open-force/sfcli-cookbook
Recipes for
● Beginners
● Power Users
● … and stuff that will impress your Dev colleagues
● All recipes available in macOS/bash or Win10/powershell flavors
Call to Action:
Request a Recipe
36. Useful resources
Subtitle placeholder
Trailhead: SFDX Quick Start
https://trailhead.salesforce.com/en/content/learn/projects/quick-start-
salesforce-dx
Peter Chittum: Apply the CLI to everyday problems
https://www.salesforce.com/video/3596221
Martin Humpolec: Salesforce DX for Admins
https://www.salesforce.com/video/3620750/
Pluralsight has Beginner Guides for Powershell and Bash
Salesforce DX
Quick Start
39. Thank You
First Name Last Name
Title of Presenter
email@salesforce.com
@twitterhandle
Remember to tell us what you think in the event survey
www.frenchtouchdreamin.com/survey