Skip to main content

SFDX on any org (preview)

·2 mins

Did you miss all the sfdx goodness on your developer org? Me too.

I have just one partner org, but have tens of them on dev edition. This meant either using the workbench, or switching to default IDE on Eclipse.

Ugh.. what is this - 2017?

I was quite excited to see the preview feature of SFDX that opens up any developer org. I hope you reread the “preview” part there? Getting started is quite easy and deploying changes to any org is enabled in 10 steps.

  1. Open your favourite command panel. Update SFDX to the latest version. Skip if you are on the bleeding edge already.
sfdx update
  1. Get yourself to preview version.
sfdx plugins:install salesforcedx@pre-release
  1. Open settings in VS Code (‘Ctrl + ,’). Change the following setting salesforcedx-vscode-core.change_set_based_tools.enabled: true

  2. Create new project. Ctrl + Shift + p | Type following command. Code will ask you for the folder in which the metadata will be stored. SFDX: Create Project with Manifest

  3. Force SFDX to use a specific API version. Open terminal within Code (Ctrl +~) and enter following command. sfdx force:config:set apiVersion=43.0

  4. Authorise org. This command will open the browser, and take you to SFDC login page to enter id and password.

    sfdx authorize org

  5. Right click on manifest > package.xml file and hit ‘sfdx: Retrieve Source from Org’

    sfdx retrieve metadata

  6. Make any changes to files. Deploy changes by right clicking on the file and selecting the obvious option, or using sfdx commands.

  7. This is important: enjoy coding salesforce! * More important: enjoy some more coffee

I bet you already knew that you can execute anonymous blocks of code by just selecting the text, hitting Ctrl + Shift + p, and selecting SFDX: Execute Anonymous Apex with Currently Selected Text?

btw.. don’t use this feature on your production environment just yet. Remember the talk about this feature being ‘preview’?