Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vs-code]

Visual Studio Code is a free source code editor developed by Microsoft for Windows, Linux and macOS. When the "Salesforce Extensions for VS Code" are added it: supports syntax highlighting and intelligent code completion for Apex, Visualforce and Lightning Components; works well with SFDX including with scratch orgs; supports debugging. Git UI is built in. Many other extensions are available.

21
votes
2answers
5k views

Two SFDX project folder structure questions

A default SFDX project is created with these folders: force-app/main/default force-app/test/default under which folders such as aura and classes and staticresources that contain components can be ...
10
votes
2answers
7k views

“Java runtime could not be located” when starting VSCode with the Salesforce Extensions

When starting VS Code (v1.21.1) with the VS Code extensions installed (v40.4) I'm getting the error message: Java runtime could not be located. Set one using the salesforcedx-vscode-apex.java.home ...
10
votes
2answers
665 views

VS Code for Salesforce - can we start from the beginning?

I get frustrated trying to get this VS Code thing off the ground. It is like someone says "Fly to Dreamforce" and I'm still trying to figure out what an airplane is. I've got VS Code installed. JDK ...
8
votes
3answers
1k views

Does VS Code SFDC IDE require Salesforce DX?

I've looked at a bunch of threads here but don't see the answer so I'm posting this question: It appears that SFDC Extensions for VS Code requires Salesforce DX which is a paid product. Is that ...
7
votes
1answer
994 views

Log to console in a Lightning Web Component

I am attempting to write a Lightning Web Component, but continually run into errors in my Javascript that I can't debug. I've been trying to log my error but when I put console.log() anywhere in the ...
7
votes
2answers
2k views

How to push code to production with Visual Studio Code & DX

I am using Visual Studio Code to develop new functionality. However, after completing the testing in the sandbox, I want to push the code to production. When I choose "SFDX: Deploy Code to org", it ...
7
votes
1answer
134 views

Visual representation code coverage in VSCode

As per answer in this post, in order to get code coverage after running test classes from VSCode, we just need to add "-c" for the sfdx test command as below: sfdx force:apex:test:run -c -u myOrg -r ...
4
votes
3answers
252 views

SFDX: Is it possible to push to a sandbox from VS Code?

I have successfully connected VS Code and pushed to several different SF environments, including Trailhead, Developer, and Production. But I can't figure out how to push to a sandbox. It looks like ...
4
votes
1answer
75 views

Can I use git repo in old format and vscode in new source format?

We want to switch to vscode but our git repo uses old source format and we don't want to convert this to new source format yet.This article talks about how to convert existing projects to new source ...
4
votes
2answers
57 views

How to get custom object fields displaying in code completion in VS Code

I am trying out the VS Code and wondering if it could be possible to display custom object fields while typing an apex code. At the moment the fields are not displayed: But when I take some standard ...
4
votes
1answer
212 views

Apex Replay Debugger: Cannot read property 'name' of null

When I select Launch Apex Replay Debugger in VS Code it asks me to select a log file and then gives me this error message: Cannot read property 'name' of null I've managed to get the Apex Replay ...
4
votes
2answers
265 views

How to set Lightning Component SFDX scratch org preferences in project-scratch-def.json?

In the Scratch Org Definition Configuration Values documentation I don't see a way to default these settings that we want to make all the time to do Lightning Component development: Setup -> ...
4
votes
1answer
2k views

No Option for “SFDX:Authorize an Org” command in VS Code Command Palette

I have performed below steps- Install CLI Install extensions "Salesforce Extension Pack" and "Saleforce CLI Itegration" I am getting only few SFDX command options in Command Palette. Also i have ...
4
votes
2answers
3k views

SFDX: create project using manifest not available

I have visual studio code installed in my desktop and updated SFDX to its latest version. However, when I open up the command palette for 'Create project', I am seeing only the following two options ...
4
votes
1answer
436 views

Salesforce DX Apex Debugging license issue

I'm trying to get Apex debugging working in VS Code, following instructions here. When I launch the debugger I see a popup You exceeded your licensed number of debugging sessions. Please end other ...
4
votes
1answer
176 views

Limitations of Apex Replay Debugger in VS Code

global class Opportunity_EmailService implements Messaging.InboundEmailHandler { public Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope env) { ...
3
votes
1answer
1k views

The max apiVersion is 44.0 error

Trying to work through the Quick Start: Lightning Web Components trailhead and getting the following error while running command: force:org:create -f config/project-scratch-def.json --setalias ...
3
votes
1answer
99 views

vscode with sfdx plugin eating too much memory

I have started using vscode with sfdx plugin to work with my sandbox and noticed that sfdx plugin inside vscode is taking too much memory. Please see the below screenshot: Is this normal? or Do i ...
3
votes
1answer
31 views

How to see sfdx commands processing indicator in VSCode

Is it possible to see some processing/loading indicator when I do sfdx commands in vscode terminal?
3
votes
1answer
805 views

No sfdx-project.json found in the root directory of your open project. Open a Salesforce DX project in VS Code

I'm using VScode for Apex dev. I have logged into Devhub org. and created a scratch org. when I try to execute pallet command: SFDX: Refresh SObject Definitions I'm getting below error. No sfdx-...
3
votes
1answer
226 views

Deploy lightning web component is getting failed with error - “--json --loglevel fatal ended with exit code 1”

I am trying to deploy a lightning web component to the org using vs-code but getting the error. Starting SFDX: Deploy Source to Org 10:09:14.43 sfdx force:source:deploy --sourcepath d:\Aakriti\...
2
votes
2answers
793 views

Migrate from Force.com IDE to VScode

We want to migrate from Force.com IDE to VScode. I have some questions around this. Can we use metadata format (src folder) with vscode, if yes than how? if not then, Would migrating to source ...
2
votes
4answers
479 views

Should the .gitignore include an entry for .vscode when using Git and VSCode

wadewegner has an example .gitignore file with the below content .DS_Store .sfdx .project .salesforce .settings node_modules .idea As part of his sfdx-simple app on GitHub. Should this file include ...
2
votes
3answers
513 views

Unable to Retrieve Source from Sandbox

From the VSCode console, I've created a new project with the command: sfdx force:project:create -n Integration --manifest I then authorize a sandbox org with the command: sfdx force:auth:web:login -r ...
2
votes
1answer
447 views

How to delete a Lightning Web Component?

I'm trying to delete new Lightning Web Component without any luck. I've tried to find it in Dev Console, but as you know it doesn't support Lightning Web Components yet. Another way I've tried to ...
2
votes
1answer
200 views

Best practice to setup a development environment with source control,vscode and sandbox

i have been working on the traditional way of developing within salesforce using Force.comIDE / aside.io / developer console. i want to move to a more robust way of writing code using a source control(...
2
votes
1answer
137 views

Apex Interactive Debugger

Is there a way to set up the Apex Interactive Debugger for VS Code for free in a Developer Edtion org? I'm a little confused on how to get started using this feature. Any guidance would be appreciated....
2
votes
2answers
2k views

Salesforce CLI is not installed - it ain't so

In VS Code. Go to command palette and enter 'Create Project with Manifest'. Prompted for a folder and get these messages: Starting SFDX: Create Project sfdx force:project:create --projectname ...
2
votes
1answer
177 views

How to generate customObject cls files in VS Code using SalesforceDX

In my VS Code project there is a folder: tools > sobjects > customObjects Which contains .cls file representations of the custom objects. I've recently run command: SFDX: Retrieve Source ...
2
votes
1answer
36 views

vsforce.retriveCommand not found

I am new to Salesforce. I installed VSCode and added some plugins then installed vforce plugin as shown in this video. I have the following plugins installed: When I try to run command in command ...
2
votes
1answer
37 views

No code coverage information was found for test run 7070U00000r8Ny3. Set “salesforcedx-vscode-core.retrieve-test-code-coverage”: true

In user setting.JSON I am using { "salesforcedx-vscode-apex.java.home":"C:\\Program Files\\Java\\jdk1.8.0_131", "salesforcedx-vscode-core.show-cli-success-msg": true, "salesforcedx-...
2
votes
2answers
39 views

Creating a project from sandbox using vscode

We donot have sfdx enabled in our instances. Can I use vscode IDE and create a proejct from sandbox with any of the salesforce extensions. I see the documentation around creating a scratch org, then ...
2
votes
1answer
355 views

VS Code and Sandbox

It is ok to say 'forget it, it doesn't work with a sandbox'. So I have successfully created a project and done a retrieve source from org. I'm focusing on APEX classes for the moment. I can open, ...
2
votes
1answer
29 views

Update sObjects in .sfdx/typings

I have a VSCode SFDX Project that we use to develop LWCs, and we recently changed some object names in the Org and now I can't upload anything to our Org. I found that there is a command to refresh ...
2
votes
1answer
74 views

ERROR: Cannot create an AuthInfo instance that will overwrite existing auth data

Background I get this error message: ERROR: Cannot create an AuthInfo instance that will overwrite existing auth data. In the VSCode output panel, when I try and run a unit test: Starting Run ...
2
votes
0answers
24 views

How to get Twilio for Salesforce Apex API intellisense in VSCode

I have this Twilio package installed (in both environments): Twilio for Salesforce: Production / Sandbox I am using VSCode to build against the Apex Query Library: Example Apex TwilioSF....
2
votes
1answer
907 views

Java runtime could not be located” when starting VSCode with the Salesforce Extensions - Java Installed

I have followed the steps suggested on "Java runtime could not be located" when starting VSCode with the Salesforce Extensions. But now I still getting the following error " Code Editor ...
1
vote
3answers
395 views

Does VS Code works for Non Salesforce DX?

I am trying to search for VS code documentation that works for non Salesforce DX using below plugin https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode But I am not ...
1
vote
1answer
832 views

LightningComponentBundle “Not available for deploy for this API version” error

I receive a strange error "Not available for deploy for this API version" for deploying LightningComponentBundle by sfdx force:source:deploy command or by VS Code Menu Item "SFDX Deploy Source To Org"....
1
vote
1answer
37 views

VS Code: How can I keep my Apex class problems from disappearing upon edits?

When deploying apex code with errors in it through SFDX, VS Code displays a handy list with convenient click-to-view functionality. But, as soon as I start to edit my file for the first problem, all ...
1
vote
4answers
595 views

Authorize Org failed in VS Code

I am new in learning lightning web component. I have installed VS Code, salesforce extension pack inside VS code, Salesforce CLI and set environment variable C:\Program Files\Salesforce CLI in my ...
1
vote
1answer
27 views

SFDX cli throwing eslint error

Does anyone have any ideas on how to fix this? It just randomly started happening when using vscode: This is how my current sfdx-project.json file looks like: { "packageDirectories": [ { ...
1
vote
1answer
216 views

Any work around on compiling file on save in vscode for sandbox?

I want to use Visual Studio Code for development in my sandbox and I was able to setup as per this article. Everything is working fine but whenever I make any change to ApexClass, I need to right ...
1
vote
1answer
655 views

Getting error while retrieving Source from Salesforce Org using VS Code and Salesforce Extension Pack

I am getting this error while trying to fetch(retrieve) source from VS Code and SF Extension Pack. STR : Right click on sfdx-project-json -> click on Retreiev Source from Org. The file is present ...
1
vote
1answer
45 views

How to use VSCode to find which reports are using a specific field

I have used Eclipse in the past but unfortunately, Eclipse and Force.com IDE no longer work for me. I have switched over to VSCode along with the Salesforce DX and forcecode extensions (among many ...
1
vote
2answers
527 views

SFDX - No org configuration found for name

Suddenly vscode stopped working with deploying the class to the sandbox I'm using and throws this message "No org configuration found for name INSTANCE NAME" I tried to create a new project for the ...
1
vote
1answer
36 views

Salesforce ORG Development Model Migration

I am just starting out with my first migration using the salesforce org development model in VS Code. I pulled in my project from my sandbox environment and made my changes and deployed my file back ...
1
vote
1answer
70 views

sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations

While deploying code in vsCode from sandbox to production I get the below error sf:INVALID_OPERATION: INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations As per ...
1
vote
1answer
20 views

plug icon is missing with default org name in vscode

As per the documentation "Change or Open Your Default Org", In vscode, I should see plug icon with the default org name but it disappeared from last few days. Here is the screenshot(stolen from this ...
1
vote
1answer
54 views

Getting an error “There are no entries to pick from” while creating LWC components

I am creating my first LWC component. While doing so When i run create LWC component command and then enter component name then I am getting an another input saying "There are no entries to pick from"...