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
23
votes
2answers
7k 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 ...
13
votes
3answers
6k 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 ...
12
votes
2answers
11k 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 ...
11
votes
1answer
1k 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 ...
10
votes
1answer
4k 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
814 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 ...
8
votes
1answer
130 views

Visual Studio Code Apex class code coverage colors

I'm looking at the code coverage results from a recent run of all the tests in an org, and I'm not sure what all the colors represent. The green and red seem fairly self explanatory: Green - covered ...
7
votes
1answer
36 views

How to customize the default template for new SFDX Project in VS Code?

More specifically, I want every new SFDX project to include a ".scripts/" directory, populated with pre-written scripts (for deployments, data transformation, whatever). Another use-case could be pre-...
6
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"....
6
votes
2answers
59 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
1k 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
5k 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
204 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
223 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
4answers
3k 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\...
4
votes
1answer
292 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
473 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-...
4
votes
1answer
267 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
2answers
5k 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
558 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
303 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 -> ...
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
119 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
4answers
1k views

VS code: how to specify Aura bundle folder?

Can anyone explain this error, that I've got in VS Code recently? When I tried to deploy code to my Org, I got this: SfdxError: You must specify the Aura bundle folder, not an individual component. ...
3
votes
2answers
124 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
1answer
105 views

can't create scratch org (fatal ended with exit code 0 no error description)

I gather that this question has been asked before but so far I haven't found anyone with the same error (or lack thereof) since the VS code status says SFDX: Create a Default Scratch Org... ...
3
votes
2answers
101 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
49 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
2k 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
459 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
2answers
2k 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 ...
3
votes
4answers
6k 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 ...
3
votes
2answers
396 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
1answer
21 views

Automatically close Output window in vsc running salesforce CLI

I have switched from Sublime to VSCode. I have found ways to make most of VSCode work the way I want. The main thing I wish I could do is when I deploy to the org if it is successful I would like ...
3
votes
0answers
848 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
436 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
852 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
216 views

Is There a Tool to Select Files to Download From an Org in VSCode?

Is there a way/extension in VSCode for selecting files to pull down from an org that doesn't require hand-editing the package.xml manifest file as one would in Workbench? This is one of the features ...
2
votes
2answers
850 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
3k 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
1k 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
95 views

Visual Studio Code does not pull Standard Objects

I have run SFDX: Create Project with Manifest and then successfully ran SFDX: Authorize an Org to connect it with my sandbox. Here is a part of my package.xml <types> <members>*</...
2
votes
4answers
4k 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 ...
2
votes
1answer
194 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
3k 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 ...
2
votes
1answer
285 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
51 views

Navigate to method definition in VSCode

I am new to VSCode. There is an Apex class like this: class MyClass1{ public static void someMethod(){ MyClass2.someMethod2(); } } Other class: MyClass2{ public static ...
2
votes
1answer
37 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
1answer
1k 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 ...