How To Get Started with Visual Studio Code for Salesforce

A step-by-step guide with screenshots to get you started in less than 30 minutes

Visual Studio Code with Salesforce

Eclipse + IDE has been one of the popular options for doing development on Salesforce’s platform. A couple of years back I posted a step by step guide on how to install and configure IDE on Eclipse. However, with Spring 18 Release of Salesforce, Salesforce has discontinued any future releases of IDE tool. Mavensmate has been another popular open source IDE tool for many developers but even that has been discontinued.

You can continue to use the Salesforce GUI or Developer Console for writing custom codes and that is okay for the lightweight development. But for heavy development work, you need a professional development tool that offers you advanced features like integration with source control, syntax highlighting, auto-completion, debugger, offline editing, etc. Visual Studio Code (or VS Code in short)  is one of the most popular source code editors among developers. This is a tool developed by Microsoft and has all the features highlighted above. One of the great things about VS code is that it has its own marketplace where 3rd parties can develop extensions to use within VS Code. And this is exactly what Salesforce has done. Developed an extension for VS Code for developing applications on the Salesforce platform. And the cherry on the top is that all this is FREE

I am not a hardcore developer, but I do need to take a look at the code or do some light development from time to time. When I tried the VS Code for the first time, it felt good – lightweight, neat and clean (reminded me of the experience when I used the Google Chrome browser for the first time)

Earlier, Salesforce CLI & Salesforce Extensions for VS Code mainly supported development with Scratch Orgs. No Sandboxes and/or dev orgs. However, after Dreamforce 2018, these tools now seem to be having support for doing development against any kind of orgs – Sandbox, dev orgs or scratch orgs. (IMPORTANT: This is still in open beta as of this writing)

So here is all you need to get started with Visual Studio Code for Salesforce. A step-by-step guide with screenshots. And it won’t take more than 30 minutes for you to download, install, configure and start using it. Say goodbye to Eclipse + IDE or Mavensmate and say hello to VS Code. And with the Salesforce extension coming directly from Salesforce and not 3rd parties you can look forward to regular release of new features and functionalities in the extension.

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

Here is a high level description of the different tools that we used in this blog post.

  1. VS Code – Is a source code editor from Microsoft. Visual Studio Code combines the simplicity of a source code editor with powerful developer tooling, like IntelliSense code completion and debugging. First and foremost, it is an editor that gets out of your way. The delightfully frictionless edit-build-debug cycle means less time fiddling with your environment, and more time executing on your ideas. (Okay, if this sounded like a sales talk, I picked it up from here)
  2. Salesforce Extensions for VS Code – An extension pack developed by Salesforce for VS Code. This extension pack includes tools for developing on the Salesforce platform in the lightweight, extensible VS Code editor. These tools provide features for working with development orgs (scratch orgs, sandboxes, and DE orgs), Apex, Lightning components, and Visualforce.
  3. Salesforce CLI – Is a powerful command line interface that simplifies development and build automation when working with your Salesforce org. Use it to:
    • Synchronise source to and from scratch orgs
    • Create and manage orgs
    • Import and export data
    • Create and execute tests
    • Create and install packages
  4. Salesforce DX – Salesforce DX includes lots of tools and new functionality. For example: the Salesforce CLI, the Salesforce Extensions for VS Code, scratch orgs and unlocked packages could all be considered parts of Salesforce DX

Once you have install and configured Visual Studio Code for Salesforce, you may want to check out my other blog post “Salesforce Code Scanner – How to Bake Quality in Your Code with Apex PMD” and start using Apex PMD with VS Code to get instant feedback on your code (Apex & Visualforce) and make it better. This blog post won’t take more than 15 minutes for you configure Apex PMD in VS Code and start using it. 

References & Useful URLs

  1. Getting Started in VS Code with Salesforce DX (YouTube Video – 17:44 Minutes)
  2. Be An Efficient Salesforce Developer with VS Code (YouTube Video – 43:04 Minutes)
  3. VS Code for Salesforce Developers: Your Questions Answered (Blog Post)
  4. Salesforce DX Setup Guide (HTML & PDF)
  5. Salesforce CLI Command Line Reference (HTML & PDF)
  6. VS Code Introductory Videos (Set of Videos to get started with VS Code)

11 thoughts on “How To Get Started with Visual Studio Code for Salesforce”

  1. Hi ashish,

    Your blog content is very informative. I learned a lot.
    Can you pls guide me, how to explain project in interview. What are the requirements/user story in a development projects.

    I am new to the Salesforce and wanted to switch my career.

  2. This was so helpful- thank you! As an admin, was looking for a tool to help search through metadata, since we won’t be able to use eclipse anymore.

    I’m not sure how to do a universal search of the metadata though- or is this the wrong tool for that?

    1. Glad to know that you found it helpful Fred. This will probably the best tool for searching inside the metadata. Download the metadata on your computer and use the OS feature to search for keywords in the metadata. The other option is to navigate to the setup menu and use Global Search. For example, say if you want to search for a particular object under custom objects, first navigate to the Setup menu and then type your search string in the Global Search box.

  3. Any idea why I’m always getting “Failed to install ‘salesforce.salesforcedx-vscode’.” and “Cannot read property ‘local’ of undefined” when trying to install any extension?


Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
Introducing All Access Pass