A step-by-step guide with screenshots to get you started in less than 30 minutes
- Visual Studio Salesforce Apex
- Visual Studio Salesforce Cli
- Sfdx Vscode
- Visual Studio Code Salesforce Dx
- Visual Studio Salesforce Extension
Visual Studio Salesforce Apex
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.
Quick Start: Visual Studio Code for Salesforce Development. Set up and integrate the recommended IDE for Salesforce development. Add to Favorites. Add to Trailmix. Get Started with Visual Studio Code 5 mins. Make Visual Studio Code Salesforce Ready 10 mins. Install and Update Salesforce Extensions for Visual Studio Code The Salesforce extensions provide features such as code completion, syntax highlighting, Apex debugging, and more for the Lightning Platform. In Visual Studio Code, click the View menu then choose Extensions. Enter salesforce extension pack in the search box. D: cd salesforce CLI cd bin sfdx force:auth:web:login -d -a DevHub But i cant able to connect Visual studio code to salesforce. I have installed visual studio code in my system. At the same time Salesforce CLI Integration and Salesforce Extension Pack also installed. But selecforce connecting commands are. Quick Start: Visual Studio Code for Salesforce Development. Set up and integrate the recommended IDE for Salesforce development. Salesforce Extensions for Visual Studio Code The Salesforce 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, Aura components, and Visualforce.
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.
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:
- 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)
- VS Code Introductory Videos (Set of Videos to get started with VS Code)
Visual Studio Salesforce Cli
Related posts:
Sfdx Vscode
Install Salesforce Extensions for Visual Studio Code
Visual Studio Code is the go-to code editor for Salesforce developers. It's free, open-source, and available for Windows, Linux, and macOS. This editor has easy-to-install extensions for syntax highlighting, code completion, and more.
In this project, we install Visual Studio Code and the recommended Salesforce Extension Pack.
- Download and install the latest version of Visual Studio Code for your operating system. If you already have Visual Studio Code installed, there’s no need to reinstall it.
- Launch Visual Studio Code.
- On the left toolbar, click the Extensions icon .
- Search for
Salesforce Extension Pack
and click Install.
Note
Some features, particularly Apex support, in Salesforce Extensions for Visual Studio Code depend on the Java Platform, Standard Edition Development Kit (JDK). Only JDK 8 and 11 are supported. If you have another version of Java installed, you need to also install JDK 8 or JDK 11. Once you install the right JDK, use the following links to configure your setup:
Ensure Your Development Environment Is Ready
Now that you’ve installed Visual Studio Code and enabled the necessary extensions, you need to test them out.
Visual Studio Code Salesforce Dx
- In Visual Studio Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Enter
sfdx
to filter for commands provided by the Salesforce Extensions.
As you use more SFDX commands, those commands will show up in the recently used
panel.
In the final step, you create your first Lightning web component and add it to your org’s home page.
Visual Studio Salesforce Extension
We won’t check any of your setup. Click Verify Step to go to the next step in the project.