SlideShare a Scribd company logo
If you can write a formula
field
pchittum@salesforce.com
@pchittum
Peter Chittum,
Director, Developer Evangelism, EMEA
You can use a Command Line
Statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such
uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially
from the results expressed or implied by the forward-looking statements we make. All statements other than statements of
historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth,
earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future
operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments
and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering
new functionality for our service, new products and services, our new business model, our past operating losses, possible
fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security
measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the
immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our
employees and manage our growth, new releases of our service and successful customer deployment, our limited history
reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on
potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for
the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and
others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web
site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not
currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase
decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to
update these forward-looking statements.
Forward-Looking Statement
Who are you?
Any Computer User
You Want To Use Command Line
You Are Not Sure Where to Start
I'm using a Mac
(and I changed my shell two weeks ago: ohmyzsh)
Myth: The Command Line Is Scary
​ > curl https://blixtar-dev-ed.my.salesforce.com/services/data/v39.0/
query?q=SELECT+Id,Name+FROM+Account+LIMIT+1 -H 'Authorization: Bearer
00D24000000IwtW!
AQ4AQMiGG9NfUlO5njwZpODWCazHSUFRgM26olREehLfu9GPqq1JWSTxwUfgncjdET.
13_G0dPm5SobOPuj_F0.vvlU9Ih44'
{"totalSize":1,"done":true,"records":[{"attributes":
{"type":"Account","url":"/services/data/v39.0/sobjects/Account/
001240000050EByAAM"},"Id":"001240000050EByAAM","Name":"DRVA"}]}
Scary!!!
names.txt
James
Colette
Oscar
Edith
​ $ sort names.txt
​ Colette
​ Edith
​ James
​ Oscar
N
ot
…quick demo
Let's state the obvious (and oversimplify)…
A command line is an app (often called a shell or terminal)
It runs little apps (commands)
How a command works
Input
(STDIN, FILE)
Output
(STDOUT)
Sound familiar?
2017-11-5T12:53:00.000+0000
HOUR(Time_Stamp__c)
12
Commands can be made to run sequentially
Even better...
Commands can talk to each other!
It's called "piping"
Semicolon: Do one thing ; then do
another
;
Only do the second if no error on first
&&
Pipe: Send output from the first to the
second
|
What does this do?
TEXT( HOUR( TIMEVALUE(Date_Field__c) ) )
​ Date_Field__c = 2018-01-13T23:21:48.000+0000
​ '23'
Deconstructed
Date_Field__c = 2018-01-13T23:21:48.000+0000
TIMEVALUE(Date_Field__c)
HOUR( 23:21:48.000+0000 )
TEXT( 23 )
'23'
Another Way to Represent This
Date_Field__c = 2018-01-13T23:21:48.000+0000
Date_Field__c TIMEVALUE() HOUR()
TEXT()
23:21:48.000+0000 23
'23'
Command Line Pipe Symbol
Date_Field__c = 2018-01-13T23:21:48.000+0000
TIMEVALUE(Date_Field__c) | HOUR() | TEXT()
'23'
There are also parameters
Input Output
Parameters
…let's revisit
that demo
Redirect: Write output from first thing
to a file
(Careful…this wipes the previous contents of the file)
>
Append: Write output from first thing to
the end of a file
>>
cd
ls
mkdir
rmdir
touch
rm
mv
cat
echo
File System Basics
change directory
list files and directories
make a directory/folder
remove a directory
make a new file
remove a file
move a file
concatenate two files (but also reads a single file to
STDOUT)
write to STDOUT
Demo
Files, Folders, Input, Output
alias
create a shortcut for a more complicated command
different ways to read a file
cat
head
tail
dog
...actually there is no 'dog', but you can do this:
$ alias dog='cat'
turn your cat into dog
wc
not the loo…
word count
counts stuff
grep
Search in files
(global regular expression print)
sed
Modify data in a stream
(stream editor)
Demo
cat, head, tail, wc, grep, sed
Salesforce DX CLI
CLI for accessing Salesforce APIs
Unix, CMD, PowerShell, WSL all supported.
$ sfdx force --help
​ $ curl https://blixtar-dev-ed.my.salesforce.com/services/data/v39.0/
query?q=SELECT+Id,Name+FROM+Account+LIMIT+1 -H 'Authorization: Bearer
00D24000000IwtW!
AQ4AQMiGG9NfUlO5njwZpODWCazHSUFRgM26olREehLfu9GPqq1JWSTxwUfgncjdET.
13_G0dPm5SobOPuj_F0.vvlU9Ih44'
{"totalSize":1,"done":true,"records":[{"attributes":
{"type":"Account","url":"/services/data/v39.0/sobjects/Account/
001240000050EByAAM"},"Id":"001240000050EByAAM","Name":"DRVA"}]}
​ $ sfdx force:data:soql:query -u blixtar -q "SELECT Id,Name FROM Account
LIMIT 1"
​ ID NAME
​ !!!!!!!!!!!!!!!!!! !!!!
​ 001240000050EByAAM DRVA
​ Total number of records retrieved: 1.
Instead of this:
You can do this:
Demo
Working with Salesforce DX CLI
Mac/Unix v Windows CMD
Windows is case insensitive
Unix file permissions
sudo versus Run As Administrator
All the other stuff
Package managers (apt, brew, chocolatey, npm)
Automating (cron, shell scripts)
Source Control (git)
Powershell, CMD, cygwin (Windows shells)
Z shell (popular powerful Unix shell)
Task Runners (gulp, grunt, …)
awk (Unix programming language)
REPLs (interactive mode programming)
More About Command Lines
CodeAcademy's Learn the Command Line course
https://www.codecademy.com/courses/learn-the-
command-line
Brief History of Command Lines
http://bit.ly/brief-history-cmd-lines
Windows and Unix Command Line equivalents:
http://bit.ly/win2unixcmd
My Stuff
Slides:
slideshare.net/chittum
Demo:
salesforce.quip.com/rFA0Af9rhUza
Get Started with Salesforce DX Today
Two easy ways to get started
Enable
Dev Hub
in a Production
or Business Org
From Setup, search
on “Dev Hub” and
then click Enabled.
Get a
Trial Org
with Dev Hub
Enabled
30 day Free Trial
Sign Up at: https://
sfdc.co/DX-Trial-
Org
Become a Salesforce DX Trailblazer
Earn 4 new badges with the Getting Started with Salesforce DX Trail
Salesforce DX
Development
Model
Git and Github
Basics
Continuous
Integration using
Salesforce DX
App Development
with Salesforce
DX
?
If You Can Write a Salesforce Formula, You Can Use the Command Line
If You Can Write a Salesforce Formula, You Can Use the Command Line

More Related Content

PPTX
Don't Fear the Command Line
PDF
If you can write a Salesforce Formula you can use the command line
PDF
Do Not Fear the Command Line
PPT
Building Visualforce Custom Events Handlers
PPTX
Apply the Salesforce CLI To Everyday Problems
PDF
Visualforce Hack for Junction Objects
PPTX
Finding Security Issues Fast!
PPTX
Integrating with salesforce
Don't Fear the Command Line
If you can write a Salesforce Formula you can use the command line
Do Not Fear the Command Line
Building Visualforce Custom Events Handlers
Apply the Salesforce CLI To Everyday Problems
Visualforce Hack for Junction Objects
Finding Security Issues Fast!
Integrating with salesforce

Similar to If You Can Write a Salesforce Formula, You Can Use the Command Line (20)

PDF
Building Mobile Apps That Deliver Salesforce to Your Employees
PPTX
Salesforce DX with Visual Studio Code
PPTX
The Power of Salesforce APIs World Tour Edition
PPT
S-Controls for Dummies
PPT
S-Controls for Dummies
PPTX
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
PDF
Developing Apex Triggers for Chatter
PPTX
Salesforce DX for Accidential Admins
PDF
Introduction to Apex Triggers
PPTX
How to Create a Scalable System using Force.com, Heroku and Iron.io
PPTX
Understanding Multitenancy and the Architecture of the Salesforce Platform
PDF
Bulkify Your Org
PPSX
Process Automation Showdown Session 2
PDF
How We Built AppExchange and our Communities on the App Cloud (Platform)
PPTX
Atl elevate programmatic developer slides
PDF
Creating an Enterprise CSS Framework: A Salesforce UX Case Study
PDF
Salesforce DX for admins - Sydney world tour
PPT
Intro to AppExchange - Building Composite Apps
PPTX
Introduction to Apex for Developers
PDF
Introduction to Force.com
Building Mobile Apps That Deliver Salesforce to Your Employees
Salesforce DX with Visual Studio Code
The Power of Salesforce APIs World Tour Edition
S-Controls for Dummies
S-Controls for Dummies
Developing Offline Mobile Apps with Salesforce Mobile SDK SmartStore
Developing Apex Triggers for Chatter
Salesforce DX for Accidential Admins
Introduction to Apex Triggers
How to Create a Scalable System using Force.com, Heroku and Iron.io
Understanding Multitenancy and the Architecture of the Salesforce Platform
Bulkify Your Org
Process Automation Showdown Session 2
How We Built AppExchange and our Communities on the App Cloud (Platform)
Atl elevate programmatic developer slides
Creating an Enterprise CSS Framework: A Salesforce UX Case Study
Salesforce DX for admins - Sydney world tour
Intro to AppExchange - Building Composite Apps
Introduction to Apex for Developers
Introduction to Force.com
Ad

More from Peter Chittum (20)

PPTX
Dreamforce 2013 - Enhancing the Chatter Feed with Topics and Apex
PDF
Winter 21 Developer Highlights for Salesforce
PPTX
LMS Lightning Message Service
PPTX
Maths Week - About Computers, for Kids
PPTX
Best api features of 2016
PDF
Streaming api with generic and durable streaming
PDF
Spring '16 Release Overview - Bilbao Feb 2016
PDF
Salesforce Platform Encryption Developer Strategy
PDF
All Aboard the Lightning Components Action Service
PDF
Boxcars and Cabooses: When One More XHR Is Too Much
PDF
Dreamforce 15 - Platform Encryption for Developers
PPTX
Platform Encryption World Tour Admin Zone
PDF
Salesforce Lightning Components and App Builder EMEA World Tour 2015
PPTX
Building Applications on the Salesforce1 Platform for Imperial College London
PDF
Elevate london dec 2014.pptx
PPTX
AngularJS App In Two Weeks
PPTX
Df14 Salesforce Advanced Developer Certification
PPTX
Javascript and Remote Objects on Force.com Winter 15
PPTX
S1 Tour Paris Developpeurs
PDF
Salesforce Developer Workshop for GDF Suez Hackathon
Dreamforce 2013 - Enhancing the Chatter Feed with Topics and Apex
Winter 21 Developer Highlights for Salesforce
LMS Lightning Message Service
Maths Week - About Computers, for Kids
Best api features of 2016
Streaming api with generic and durable streaming
Spring '16 Release Overview - Bilbao Feb 2016
Salesforce Platform Encryption Developer Strategy
All Aboard the Lightning Components Action Service
Boxcars and Cabooses: When One More XHR Is Too Much
Dreamforce 15 - Platform Encryption for Developers
Platform Encryption World Tour Admin Zone
Salesforce Lightning Components and App Builder EMEA World Tour 2015
Building Applications on the Salesforce1 Platform for Imperial College London
Elevate london dec 2014.pptx
AngularJS App In Two Weeks
Df14 Salesforce Advanced Developer Certification
Javascript and Remote Objects on Force.com Winter 15
S1 Tour Paris Developpeurs
Salesforce Developer Workshop for GDF Suez Hackathon
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
Spectral efficient network and resource selection model in 5G networks

If You Can Write a Salesforce Formula, You Can Use the Command Line

  • 1. If you can write a formula field pchittum@salesforce.com @pchittum Peter Chittum, Director, Developer Evangelism, EMEA You can use a Command Line
  • 2. Statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements. Forward-Looking Statement
  • 3. Who are you? Any Computer User You Want To Use Command Line You Are Not Sure Where to Start
  • 4. I'm using a Mac (and I changed my shell two weeks ago: ohmyzsh)
  • 5. Myth: The Command Line Is Scary ​ > curl https://blixtar-dev-ed.my.salesforce.com/services/data/v39.0/ query?q=SELECT+Id,Name+FROM+Account+LIMIT+1 -H 'Authorization: Bearer 00D24000000IwtW! AQ4AQMiGG9NfUlO5njwZpODWCazHSUFRgM26olREehLfu9GPqq1JWSTxwUfgncjdET. 13_G0dPm5SobOPuj_F0.vvlU9Ih44' {"totalSize":1,"done":true,"records":[{"attributes": {"type":"Account","url":"/services/data/v39.0/sobjects/Account/ 001240000050EByAAM"},"Id":"001240000050EByAAM","Name":"DRVA"}]}
  • 8. Let's state the obvious (and oversimplify)… A command line is an app (often called a shell or terminal) It runs little apps (commands)
  • 9. How a command works Input (STDIN, FILE) Output (STDOUT)
  • 11. Commands can be made to run sequentially Even better... Commands can talk to each other! It's called "piping"
  • 12. Semicolon: Do one thing ; then do another ;
  • 13. Only do the second if no error on first &&
  • 14. Pipe: Send output from the first to the second |
  • 15. What does this do? TEXT( HOUR( TIMEVALUE(Date_Field__c) ) ) ​ Date_Field__c = 2018-01-13T23:21:48.000+0000 ​ '23'
  • 17. Another Way to Represent This Date_Field__c = 2018-01-13T23:21:48.000+0000 Date_Field__c TIMEVALUE() HOUR() TEXT() 23:21:48.000+0000 23 '23'
  • 18. Command Line Pipe Symbol Date_Field__c = 2018-01-13T23:21:48.000+0000 TIMEVALUE(Date_Field__c) | HOUR() | TEXT() '23'
  • 19. There are also parameters Input Output Parameters
  • 21. Redirect: Write output from first thing to a file (Careful…this wipes the previous contents of the file) >
  • 22. Append: Write output from first thing to the end of a file >>
  • 23. cd ls mkdir rmdir touch rm mv cat echo File System Basics change directory list files and directories make a directory/folder remove a directory make a new file remove a file move a file concatenate two files (but also reads a single file to STDOUT) write to STDOUT
  • 25. alias create a shortcut for a more complicated command
  • 26. different ways to read a file cat head tail
  • 27. dog ...actually there is no 'dog', but you can do this: $ alias dog='cat' turn your cat into dog
  • 28. wc not the loo… word count counts stuff
  • 29. grep Search in files (global regular expression print)
  • 30. sed Modify data in a stream (stream editor)
  • 31. Demo cat, head, tail, wc, grep, sed
  • 32. Salesforce DX CLI CLI for accessing Salesforce APIs Unix, CMD, PowerShell, WSL all supported. $ sfdx force --help
  • 33. ​ $ curl https://blixtar-dev-ed.my.salesforce.com/services/data/v39.0/ query?q=SELECT+Id,Name+FROM+Account+LIMIT+1 -H 'Authorization: Bearer 00D24000000IwtW! AQ4AQMiGG9NfUlO5njwZpODWCazHSUFRgM26olREehLfu9GPqq1JWSTxwUfgncjdET. 13_G0dPm5SobOPuj_F0.vvlU9Ih44' {"totalSize":1,"done":true,"records":[{"attributes": {"type":"Account","url":"/services/data/v39.0/sobjects/Account/ 001240000050EByAAM"},"Id":"001240000050EByAAM","Name":"DRVA"}]} ​ $ sfdx force:data:soql:query -u blixtar -q "SELECT Id,Name FROM Account LIMIT 1" ​ ID NAME ​ !!!!!!!!!!!!!!!!!! !!!! ​ 001240000050EByAAM DRVA ​ Total number of records retrieved: 1. Instead of this: You can do this:
  • 35. Mac/Unix v Windows CMD Windows is case insensitive Unix file permissions sudo versus Run As Administrator
  • 36. All the other stuff Package managers (apt, brew, chocolatey, npm) Automating (cron, shell scripts) Source Control (git) Powershell, CMD, cygwin (Windows shells) Z shell (popular powerful Unix shell) Task Runners (gulp, grunt, …) awk (Unix programming language) REPLs (interactive mode programming)
  • 37. More About Command Lines CodeAcademy's Learn the Command Line course https://www.codecademy.com/courses/learn-the- command-line Brief History of Command Lines http://bit.ly/brief-history-cmd-lines Windows and Unix Command Line equivalents: http://bit.ly/win2unixcmd
  • 39. Get Started with Salesforce DX Today Two easy ways to get started Enable Dev Hub in a Production or Business Org From Setup, search on “Dev Hub” and then click Enabled. Get a Trial Org with Dev Hub Enabled 30 day Free Trial Sign Up at: https:// sfdc.co/DX-Trial- Org
  • 40. Become a Salesforce DX Trailblazer Earn 4 new badges with the Getting Started with Salesforce DX Trail Salesforce DX Development Model Git and Github Basics Continuous Integration using Salesforce DX App Development with Salesforce DX
  • 41. ?