A step-by-step guide with screenshots to get you started in less than 30 minutes
Eclipse + Force.com IDE has been one of the popular options for doing development on Salesforce’s Force.com platform. A couple of years back I posted a step by step guide on how to install and configure Force.com IDE on Eclipse. However, with Spring 18 Release of Salesforce, Salesforce has discontinued any future releases of Force.com IDE tool. Mavensmate has been another popular open source Force.com 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 + Force.com 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.
Here is a high level description of the different tools that we used in this blog post.
- 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)
- 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.
- 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
- 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
- Getting Started in VS Code with Salesforce DX (YouTube Video – 17:44 Minutes)
- Be An Efficient Salesforce Developer with VS Code (YouTube Video – 43:04 Minutes)
- VS Code for Salesforce Developers: Your Questions Answered (Blog Post)
- Salesforce DX Setup Guide (HTML & PDF)
- Salesforce CLI Command Line Reference (HTML & PDF)
- VS Code Introductory Videos (Set of Videos to get started with VS Code)