How To Setup Visual Studio Code For Salesforce Development

How To Setup Visual Studio Code For Salesforce Development

In the recent past we have observed that Visual Studio Code (VS Code) is picking up popularity among open source IDEs for code development across multiple programming languages. JavaScript based frameworks, Python based application development, Salesforce Apex Code development, HTML, CSS based Front End development and so on are the most popular choices working with VS Code. This powerful behavior of supporting multiple platforms resides in the ability to adopt Plugins & Extension Packs that supports most popular programming languages & frameworks, and I believe VS Code has does a brilliant job so far.

In this article we will look into detailed steps to setup Visual Studio Code as IDE for Salesforce code development. Here are the quick list of the components that we would working with in the steps below,

  1. Install & Configure Visual Studio Code
  2. Install & Configure Salesforce CLI
  3. Install & Configure Salesforce Extension Pack
  4. Create Test Salesforce Project
  5. Authorize Salesforce Org

We will discuss the individual configuration for each of the moving parts contributing to this setup in the upcoming steps,

Install & Configure Visual Studio Code

  • We can download the latest VS Code Setup from the following Url: https://code.visualstudio.com
    How To Setup Visual Studio Code For Salesforce Development 
  • Click on “Download for Windows”
    How To Setup Visual Studio Code For Salesforce Development
  • Save the setup file
    How To Setup Visual Studio Code For Salesforce Development
    How To Setup Visual Studio Code For Salesforce Development
  • Open the setup file by right click > Open. Please make sure you don’t use “Run as Administrator” option since VS Code cannot be installed with Admin privileges as suggested by following alert message.
    How To Setup Visual Studio Code For Salesforce Development
    How To Setup Visual Studio Code For Salesforce Development
  • Accept the License Terms and Click Next
  • Click Next
  • Click Next
  • Make sure “Add To Path” is checked and Click Next
  • Click Install

    Wait till the setup completes the installation, which should be really a quick install
    How To Setup Visual Studio Code For Salesforce Development 
  • Click Finish & Launch VS Code to make sure installation works just fine
    How To Setup Visual Studio Code For Salesforce Development
    How To Setup Visual Studio Code For Salesforce Development

Install & Configure Salesforce CLI

  • You can download the Salesforce CLI from the following Url: https://developer.salesforce.com/tools/sfdxcli
    How To Setup Visual Studio Code For Salesforce Development
    How To Setup Visual Studio Code For Salesforce Development 
  • Click “Download for Windows” depending on windows version you are running on
    How To Setup Visual Studio Code For Salesforce Development
  • Save the CLI setup file

    How To Setup Visual Studio Code For Salesforce Development 
  • Open the setup file by right click > Open
  • Keep the defaults and Click Next
  • Keep the defaults and Click Install

    Wait till setup completes the installation, which should be really a quick install

  •  Click Close to complete the installation
    How To Setup Visual Studio Code For Salesforce Development

Install & Configure Salesforce Extension Pack

  • Launch VS Code
    How To Setup Visual Studio Code For Salesforce Development
  • On the left most menu panel, Click Extensions Icon of press “Ctrl + Shift + X” & Search for “Salesforce Extension Pack”. Install Salesforce Extension Pack by clicking “Install” and wait till installation completes

  • Launch a new terminal by going to Terminal Menu > New Terminal or press “Ctrl + Shift + `”, we have to validate the installation of Salesforce CLI by typing “SFDX” in the new terminal. If we get the following similar outcome then we can ensure a successful installation.

Create Test Salesforce Project

  • Launch VS Code
  • Press “Ctrl + Shift + P” to see all available commands from all installed plugins & extensions
    How To Setup Visual Studio Code For Salesforce Development
  • Search for “SFDX: Create Project with Manifest” and select it
    How To Setup Visual Studio Code For Salesforce Development
  • Select project template as Standard or whatever suits you the best
    How To Setup Visual Studio Code For Salesforce Development
  • Enter the desired name of the Project, whatever suits you
    How To Setup Visual Studio Code For Salesforce Development
  • Select the folder location to save this project on the disk
    How To Setup Visual Studio Code For Salesforce Development

And sure enough we will get our new Salesforce project created with the manifest file

How To Setup Visual Studio Code For Salesforce Development

Authorize Salesforce Org

  • Launch VS Code
  • Press “Ctrl + Shift + P” to see all available commands from all installed plugins & extensions
  • Search for “SFDX: Authorize an Org” and select it
    How To Setup Visual Studio Code For Salesforce Development
  • Select for “Org Url” Template, I will go by project default for this demo
    How To Setup Visual Studio Code For Salesforce Development
  • Enter the Org Alias to recognize your Org by alias, I have specified SFOrg as alias for this demo
    How To Setup Visual Studio Code For Salesforce Development

This process with direct you to the Salesforce Login Page, where you can specified the login credential for your Org (no matter Prod or Sandbox). Enter your credentials

 

Once successfully login to the Salesforce Org. visit the VS Code again and sure enough we get the notifications to successfully authorize the Org.

How To Setup Visual Studio Code For Salesforce Development 

 

Hope you enjoyed this article. Please leave your comments to let me know how you do like the content and how you do find it helpful to learn the topic.


Similar Articles