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
41
votes
2answers
16k 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 ...
18
votes
3answers
20k 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 ...
4
votes
1answer
1k 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 ...
9
votes
2answers
11k 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 ...
16
votes
3answers
28k 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 ...
9
votes
3answers
24k 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
2answers
248 views

VS Code Setup - Create project with manifest error

When I try to create project with manifest it is giving me this error: Starting SFDX: Create Project 12:39:56.757 sfdx force:project:create --projectname Dev --outputdir c:\ --template standard --...
1
vote
1answer
727 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
1answer
242 views

Lightning Web Component is not available in App Builder when deploying from VS code

I am used to of 'The Welkin Suite' editor for official development. I am not frequent user of VS code. Only using VS code for personal use. Yesterday I observed weird issue while deploying LWC ...
1
vote
1answer
790 views

My VSCODE (SFDX) is not running - Command failed with ENOENT: npm

All was working fine till the morning untill, in the afternoon when i tried to run some create LWC commands. Now, no SFDX commands will work, i am getting the following error : 04:30:38.633 sfdx ...
5
votes
1answer
10k 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-...
28
votes
1answer
12k 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
1answer
2k 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 ...
8
votes
1answer
1k views

LWC Folder Structure

Id there a way to organize my components inside sub folders and not having them saved directly under LWC? Just a simple example, if I have 10 components related to Contacts and another 10 related to ...
7
votes
1answer
14k views

Running unit test class from VSCode

I am new to VSCode. The Org is setup in VSCode. ForceCode, vforce, Salesforce CLI Integration and some other extensions installed in the VSCode. Org is authorized. I am able to save my changes in ...
5
votes
3answers
4k 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-...
5
votes
1answer
900 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 ...
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 ...
2
votes
2answers
3k 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
9answers
23k views

Cannot connect a Salesforce org using Authorize an org in VS Code

Using VS Code, after I enter the command line "Authorize an org" I get redirected to Salesforce login and can successfully log in. However I then get the error "This site can't be reached" The URL ...
13
votes
6answers
27k 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 ...
13
votes
1answer
10k 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
1answer
788 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) { ...
5
votes
8answers
22k 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 ...
5
votes
1answer
2k 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 ...
1
vote
1answer
3k views

Unable to install sfdx plugins:install @salesforce/lwc-dev-server

I am using 1.38.1 version of VSCode and i have done "http.proxyStrictSSL": false I am still getting error Error: unable to get local issuer certificate i tried in my personal laptop. Now ...
1
vote
2answers
2k views

Why is ESLint not working properly for Lightning Web Components in VS Code and how to make it work?

I'm trying to set up an environment to play around with LWCs. While doing a Analyze Your Code and Deploy It to Your Org unit from the Set Up Your Lightning Web Components Developer Tools module on ...
1
vote
2answers
1k views

VSCode Lists Erroneous Apex Problems

I'm using VSCode with Github and Deploying to a Sandbox. When I save my classes, VSCode lists problems which don't exist and which don't clear when the class is deployed successfully. For example, all ...
1
vote
1answer
290 views

Use Prettier in VS Code to format Visualforce

I'm struggling to get the Prettier for Apex (installed as per instructions here enter link description here) to format Visualforce Pages and Components. I have a vague memory of this working for me in ...
1
vote
1answer
112 views

No Package.xml Found In Destructive MDAPI Deployment

I've already looked at the existing questions and made sure of the following: Only package.xml & destructiveChanges.xml are in the folder I'm trying to deploy. package.xml is empty outside of the ...
0
votes
0answers
28 views

Scratch Org Create Succeeded after timeout now how do I register org in my vscode from ScratchOrgInfo

So I issued a command to create a scratch org (based on a shape) and it took a long time to execute. In fact, it timed out. However the error code gave me the ID of my org to query for, e.g.: sfdx ...
0
votes
1answer
93 views

Why are my recordtypes not being updated, they are going into the wrong folder

I have a CLI situation whereby the recordtypes I make changes too are not being updated on a retrieve. I cannot find flaws in my process, I change the connected org correctly my XML has the fields, ...
0
votes
1answer
1k views

Installing SFDX

I am trying to install sfdx on my windows 64 to create lwc, I have VS code with salesforce extension and lwc extension. I downloaded sfdx cli from here. https://developer.salesforce.com/tools/sfdxcli ...