Close Menu
SalesforceCodex
    Facebook X (Twitter) Instagram
    Trending
    • The Ultimate Guide to Data Cleanup Techniques for Salesforce
    • How to Leverage Model Context Protocol (MCP) to Enhance Salesforce AI
    • Top Mistakes Developers Make in Salesforce Apex Triggers
    • Introducing Agentforce3 to Salesforce Developers
    • The Ultimate Guide to Apex Order of Execution for Developers
    • How to Handle Bulkification in Apex with Real-World Use Cases
    • How to Confidently Manage Transactions in Salesforce Apex
    • Building a Dynamic Tree Grid in Lightning Web Component
    Facebook X (Twitter) Instagram
    SalesforceCodex
    Subscribe
    Saturday, August 2
    • Home
    • Salesforce Platform
      • Architecture
      • Apex
      • Lightning Web Components
      • Integration
      • Flows & Automation
      • Best Practices
      • Questions
      • News
      • Books Testimonial
    • Industries
      • Artificial Intelligence
    • Hire Me
    • Certification
      • How to Prepare for Salesforce Integration Architect Exam
      • Certification Coupons
    • Downloads
      • Salesforce Release Notes
      • Apex Coding Guidelines
    • About Us
      • Privacy Policy
    • Contact Us
    SalesforceCodex
    Home»Salesforce»Salesforce Development in Visual Studio Code

    Salesforce Development in Visual Studio Code

    Dhanik Lal SahniBy Dhanik Lal SahniOctober 13, 20186 Comments3 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Salesforce Development in Visual Studio Code
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Salesforce Development in Visual Studio Code


    Force.com has discontinued its IDE for further development process. Instead of Force.com IDE, Salesforce Extensions for VS Code is recommended.

    Visual Studio Code is a source code editor developed by Microsoft for all major OS like Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, code refactoring and test coverage.

    For working in Visual Studio Code for Salesforce development, Four major steps are there
    1. Authenticate Visual Studio Code with Salesforce Org
    2. Code Retrieval
    3. Code Changes
    4. Code Deployment.

    Before starting, install Visual Studio Code from https://code.visualstudio.com/
    Once Visual Studio Code is installed, install extensions Salesforce Extensions for VS Code and ForceCode by clicking highlighted icon.

    Let us now start each step one by one.
    1. Authenticate Visual Studio Code with Salesforce Org:
    We have to authorize Visual studio code to connect and get/save code. You can connect with Dev Org for this exercise.

    Before connecting with Org, first open folder where code will be retrieved. Click highlighted button to open folder. You can also use File->Open Folder to open folder.

    Open command window from View->Command Palette. It will open popup like below screenshot.

    In that window, write ForceCode: ForceCode Menu to authenticate using dev org. Select New Org from list to start authentication process.

    This will open org selection popup. You can select Sandbox or production org from list. Let us select Sandbox/Test for connecting with dev Org.


    This will open org login page. Login into org to step in next process.

    Once authentication is successful, we will get src folder and json files as shown in below image in opened folder. In footer/tray one menu ForceCode Menu is also added.

    2. Code Retrieval
    Now Visual Studio Code is connected with Dev Org. Let us retrieve code from org. You can retrieve complete code or you can use package.xml to get specific code.

    Click ForceCode menu from bottom or View->Command Palette. This will open popup to select connected Org. Select org which you have connected.

    Once you selected org. It will open another popup to set behavior to save on server. If you select yes, each time you save code it will deploy code to connected org. So let us select No, we will deploy code once we complete one code block.

    Let us get code from below package.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <Package xmlns="http://soap.sforce.com/2006/04/metadata">
       <types>
            <members>TestClass</members>
            <name>ApexClass</name>
        </types>
        <version>44.0</version>
    </Package>
    

    Open command palette once again and select Retrieve package/Metadata to get code.

    It will open list of options to get code. Select first option Retrieve by package.xml

    It will get code as mentioned in Package.xml.

    3. Code Changes
    After code is retrieved, do your changes. For example I have added code
    * Code Chage from Visual Studio Code*/

    4. Code Deploy
    Let us deploy this code change to dev org. Open command palette once again and select Deploy package.

    On another popup select Deploy from package.xml to deploy code from package.

    Once deployement process, it will show status in output window.

    Summary:
    Visual Studio is very light tool for coding and performance wise also it is very fast. All features of Salesforce can be used here.

    Apex code IDE IDE for Salesforce Development salesforce Salesforce IDE Visual Studio Code
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleException Logging in Custom Object : Salesforce Apex
    Next Article Visual Studio Code and Code Versioning in TFS
    Dhanik Lal Sahni
    • Website

    Related Posts

    By Dhanik Lal Sahni6 Mins Read

    How to Leverage Model Context Protocol (MCP) to Enhance Salesforce AI

    July 28, 2025
    By Dhanik Lal Sahni7 Mins Read

    Top Mistakes Developers Make in Salesforce Apex Triggers

    July 25, 2025
    By Dhanik Lal Sahni14 Mins Read

    The Ultimate Guide to Apex Order of Execution for Developers

    July 20, 2025
    View 6 Comments

    6 Comments

    1. Kishan on October 23, 2018 12:41 am

      Thank You For sharing such a wonderful Article on Visual Studio code IDE with SFDC

      Reply
      • Dhanik Lal Sahni on October 23, 2018 5:59 pm

        Thank You Kishan.

        Reply
    2. Madhu on October 29, 2018 9:59 pm

      Well explained in step by step. Easy to configure. Thank you for the post.

      Reply
      • Dhanik Lal Sahni on November 2, 2018 12:03 am

        Thank You Madhu.

        Reply
    3. Michael Shumenko on August 20, 2019 9:24 pm

      JetForcer is a powerful and modern IDE for Salesforce development.
      Just try it out at compare with VSCode.

      https://jetforcer.com/

      Reply
    4. Gugulothu Anil on September 27, 2019 2:15 pm

      very helpful

      Reply
    Leave A Reply Cancel Reply

    Ranked #1 Salesforce Developer Blog by SalesforceBen.com
    SFBenTopDeveloper
    Ranked #4 Salesforce Developer Blog by ApexHours.com
    ApexHoursTopDevelopers
    Categories
    Archives
    Tags
    apex (116) apex best practices (5) apex code best practice (10) apex code optimization (6) Apex logging (4) apex rest (11) apex trigger best practices (6) architecture (22) Asynchronous apex (9) AWS (5) batch apex (10) best code practice (4) code optimization (9) custom metadata types (5) design principle (9) flow (16) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (66) lightning-combobox (5) lightning-datatable (10) lightning component (32) Lightning web component (64) lwc (53) named credential (8) news (4) optimize apex (5) optimize apex code (6) optimize apex trigger (5) Permission set (4) Queueable (9) queueable apex (4) rest api (23) salesforce (150) salesforce apex (52) salesforce api integration (5) Salesforce Interview Question (5) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    MailChimp

    Expert Salesforce Developer and Architect
    Ranked #1 SALESFORCE DEVELOPER BLOG BY SALESFORCEBEN.COM
    Featured on Top Salesforce Developer Blog By ApexHours
    Recent Posts
    • The Ultimate Guide to Data Cleanup Techniques for Salesforce
    • How to Leverage Model Context Protocol (MCP) to Enhance Salesforce AI
    • Top Mistakes Developers Make in Salesforce Apex Triggers
    • Introducing Agentforce3 to Salesforce Developers
    • The Ultimate Guide to Apex Order of Execution for Developers
    Ranked in Top Salesforce Blog by feedspot.com
    RSS Recent Stories
    • Top 10 Salesforce CRM Trends to Watch in 2025 July 18, 2025
    • Discover the Top 10 Salesforce AppExchange Apps to Boost Productivity July 10, 2025
    • Top 20 Salesforce Data Cloud Interview Questions & Answers for Admins June 5, 2025
    • How to Connect Excel to Salesforce to Manage Your Data and Metadata February 9, 2025
    • Difference Between With Security and Without Security in Apex January 2, 2025
    Archives
    Categories
    Tags
    apex (116) apex best practices (5) apex code best practice (10) apex code optimization (6) Apex logging (4) apex rest (11) apex trigger best practices (6) architecture (22) Asynchronous apex (9) AWS (5) batch apex (10) best code practice (4) code optimization (9) custom metadata types (5) design principle (9) flow (16) google (6) google api (4) integration (19) integration architecture (6) lighting (8) lightning (66) lightning-combobox (5) lightning-datatable (10) lightning component (32) Lightning web component (64) lwc (53) named credential (8) news (4) optimize apex (5) optimize apex code (6) optimize apex trigger (5) Permission set (4) Queueable (9) queueable apex (4) rest api (23) salesforce (150) salesforce apex (52) salesforce api integration (5) Salesforce Interview Question (5) salesforce news (5) salesforce question (5) solid (6) tooling api (5) Winter 20 (8)

    Get our newsletter

    Want the latest from our blog straight to your inbox? Chucks us your detail and get mail when new post is published.
    * indicates required

    Facebook X (Twitter) Instagram Pinterest YouTube Tumblr LinkedIn Reddit Telegram
    © 2025 SalesforceCodex.com. Designed by Vagmine Cloud Solution.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.