Skip to content

Configuring VS Code for SFDX

Patrick Gidich edited this page Mar 19, 2019 · 9 revisions

Why Visual Studio Code?

Visual Studio Code (VSCode) is a free, cross-platform code editor with a strong plug-in community to extend its capabilities. Salesforce has created plug-ins to work with Visual Studio Code and has become the preferred editor for editing code with SFDX.

SFDX development is performed in a Scratch Org which is an empty Salesforce Environment; unlike a sandbox, the Scratch Org will have no data in it when it is created. To ensure data is available in a Scratch Org to support development and testing it will have to be scripted in.

Visual Studio Code can be used by both developers and QA staff alike.

VS Code SFDX Setup

  1. Setup Dev Hub and G2P in your Salesforce edition
    1. Navigate to Setup > Settings > Development > Dev Hub
    2. Move the slider to enable Dev Hub and G2P Packaging
  2. Download and Install Visual Studio Code
  3. Install the official Salesforce Extension Pack into Visual Studio Code.
  4. From a command prompt in Visual Studio Code issue sfdx force:auth:web:login to log into the Dev Hub using the CLI, which will authorize you to create scratch orgs.

Resources

Note: A good template to use when making a project from scratch: https://github.com/sfdx-isv/sfdx-falcon-template

-- Valerie Belova

Clone this wiki locally