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.

Filter by
Sorted by
Tagged with
21
votes
2answers
6k 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
9k 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
1answer
2k 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 ...
10
votes
2answers
745 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 ...
9
votes
3answers
4k 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 ...
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
460 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 ...
6
votes
2answers
55 views

In VSCode is it possible to make SFDX Retrieve Source From Org confirm before proceeding?

I'd like VSCode to confirm with me when I run command: SFDX Retrieve Source From Org Before proceeding, because I regularly select the wrong option when right clicking. Is there a setting or option ...
5
votes
3answers
565 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 ...
5
votes
2answers
3k 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
1answer
123 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
1answer
148 views

VS Code Salesforce plugin deploy does not provide an error message

VS Code plugin for salesforce seems to be broken yesterday, It does not provide proper error message in case of failure. Tried this in a developer org as well as scratch org. Neither deploy code or ...
4
votes
1answer
254 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
4k 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
494 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
2answers
283 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
227 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) { ...
4
votes
4answers
1k 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\...
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
2k 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"....
3
votes
1answer
108 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
2answers
81 views

Do I really need to install Prettier locally?

Well, I am trying to set up code formatting process in my project and I am following this guide Set Up the Prettier Code Formatter for Salesforce Projects where steps 1 and 2 include installing ...
3
votes
2answers
46 views

SFDX Question. Can source:status be used in sandboxes?

Quick question, can I use source:status on sandbox? I'm a sf developer and I am still learning how to use sfdx in org development model (since its the one we use) and was wondering if source:status ...
3
votes
1answer
37 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
2answers
167 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 ...
3
votes
1answer
1k 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
2answers
135 views

Don't see option “SFDX: Push Source to Default Scratch Org” in the command palette in VS Code

I have an sfdx project opened in VS Code as workspace folder. I don't see the option for "SFDX: Push Source to Default Scratch Org" in the command palette. Other commands like "SFDX: Refresh SObject ...
3
votes
0answers
533 views

command 'sfdx.force.project.with.manifest.create' not found

I've installed the latest versions of VScode, the Salesforce CLI, and the VS code Salesforce CLI Extension but when I go to run SFDX: Create Project with Manifest or any SFDX command, I receive an ...
2
votes
4answers
421 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 ...
2
votes
4answers
646 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
2answers
823 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
3answers
1k 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
824 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
240 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
166 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
4k 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
33 views

How to run the command “sfdx force:apex:test:run” so that System.debug statements are printed in the console?

I love the option of running test methods from VSCode by clicking on Run Test link that appears below the @isTest annotation. This works well but when a test method fails, I go ahead and add a System....
2
votes
2answers
1k views

How do I retrieve all the code from lightning?

My boss had been muddling through Salesforce by creating custom objects and triggers using the Lightning Web Interface. I want to pull all his work down in VS Code, commit it to git, and continue ...
2
votes
1answer
319 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
25 views

How to create Custom SOObjects using Visual Studio Code?

I'm a .Net developer. Just started learning Salesforce. I would like to setup a dev environment using Visual Studio Code. I'm able to do that with the help of Salesforce Extension Pack. However I'm ...
2
votes
1answer
179 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
51 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
497 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
0answers
41 views

How to setup ESLint in VSCode to work with every project?

Below is the process I am doing in VSCode to setup for every project I create: run command npm init from project folder and this is creating package.json file. Run the command eslint --init and it ...
2
votes
1answer
44 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
141 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
38 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
1k 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
4answers
2k 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 ...