Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Salesforce CLI

289 views

Published on

Slide deck from my talk at the London Salesforce Developers March meetup on using the Salesforce CLI to retrieve and deploy metadata, run tests, retrieve and update data and create metadata.

Published in: Technology
  • Hello! I have searched hard to find a reliable and best research paper writing service and finally i got a good option for my needs as ⇒ www.WritePaper.info ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Salesforce CLI

  1. 1. Salesforce CLI The developer multi-tool
  2. 2. About Me ☑ CTO of BrightGen ☑ Salesforce MVP ☑ Certified Technical Architect
  3. 3. ☑ Prime Minicomputer - PrimeOS ☑ VAX Minicomputer - VMS ☑ HP 9000 - HP UX (Unix) ☑ IBM RS/6000 - AIX (Unix)
  4. 4. Salesforce CLI ☑ sfdx executable ☑ Local installation ☑ Part of SalesforceDX ☑ One tool to rule them all
  5. 5. Authorisation ☑ Login once ☑ CLI manages all tokens ☑ Authorise through browser : sfdx force:auth:web:login ☑ Specify existing with -u sfdx force:org:open -u keir.bowden@sfdx.deploy
  6. 6. Deployment Structured src and package.xml
  7. 7. Deployment ☑ Wait for complete sfdx force:mdapi:deploy -d src -w 2 ☑ Poll sfdx force:mdapi:deploy -d src sfdx force:mdapi:deploy:report -i <job>
  8. 8. Running Tests ☑ All in your namespace sfdx force:apex:test:run -l RunLocalTests ☑ Specific Tests sfdx force:apex:test:run -l RunSpecifiedTests -t ConfigAccessorTest
  9. 9. Retrieving Metadata Requires package.xml
  10. 10. Retrieving Metadata ☑ Wait for complete sfdx force:mdapi:retrieve -k retrieve/package.xml -r . ☑ Poll sfdx force:mdapi:retrieve -k retrieve/package.xml -r . -w 0 sfdx force:mdapi:retrieve:report -i <jobId> -r .
  11. 11. Destructive Changes Empty package.xml destructiveChanges.xml sfdx force:mdapi:deploy -d destroy
  12. 12. Retrieving Data ☑ sfdx force:data:soql:query -q <query>
  13. 13. Updating Data ☑ sfdx force:data:record:update -s <type> -i <id> -v "<field>=<value> <field>=<value>"
  14. 14. Creating Metadata ☑ Apex Class: sfdx force:apex:class:create -n <name> -d <directory> ☑ Lightning Component sfdx force:lightning:component:create -n <name> -d <directory> ☑ Visualforce Page sfdx force:visualforce:page:create -n <name> -d <directory> ☑ No -u option Created on local file system only
  15. 15. Scripting
  16. 16. Chain Commands 1. Deploy Codebase 2. Run Tests
  17. 17. Processing Output ☑ Reformat ☑ Report Results ☑ Take action
  18. 18. Orchestration 1. Clone git repository 2. Deploy 3. Store commit id
  19. 19. More Information ☑ Home page : sforce.co/2vyFuuY ☑ Setup guide: sforce.co/2FIDlpS ☑ Command reference : sforce.co/2pdPEAe ☑ Release notes : sforce.co/2DWaWH7 ☑ Blog series : bobbuzz.me.uk/2GvVaIb
  20. 20. Questions?

×