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
0
votes
0answers
161 views

Why am I getting errors when trying to push code to scratch org?

I'm trying to push my code into a scratch org using SFDX. I keep getting errors which don't make sense -- many of them are saying how a variable doesn't exist and I scan the class to see the variable ...
1
vote
0answers
119 views

VS Code: disable the Refresh SObject Definitions prompt

In VS Code, how do I disable the "You don't have any sObjects cached locally" prompt? I don't want to use this feature in my projects.
0
votes
0answers
151 views

Deploying lightning web component from VScode to sandbox takes more time

I am trying to deploy lightning web component from VScode to the sandbox using the command SFDX:Deploy Source to Org. It was working fine previously but for the past 2 days, deploying is taking more ...
1
vote
1answer
562 views

Issue with setting default org in VSCode

I am trying to set a default org in VScode but it is not working. I get a Cannot read property 'getInstance' of undefined error. ERROR running force:auth:web:login: Cannot read property 'getInstance' ...
0
votes
0answers
64 views

Command 'CCDX: Deploy Source To Salesforce' resulted in an error (Cannot read property 'path' of undefined)

Facing below error when I am trying to deploy LWC from VS Code Command 'CCDX: Deploy Source To Salesforce' resulted in an error (Cannot read property 'path' of undefined) Steps to generate error: ...
6
votes
1answer
1k views

Deprecated or invalid utility class SLDS

I have been trying to use SLDS in LWC. However, I am noticing these issues recently. The same style classes were working before without any issues. Does anything worng with my VS code or is really ...
3
votes
3answers
2k views

Cannot read property 'getInstance' of undefined

When trying to authorize an org/ trying to deploying source to org / retrieve the source from an org i'm getting below error. kindly help me to resolve this issue.
2
votes
0answers
375 views

Specifying individual CustomField in package.xml (vscode) does not deploy to Org, but when retrieving by object it does?

When retrieving CustomFields in package.xml by specifying: <types> <members>ObjectName.FieldName__c</members> <name>CustomField</name> </types> They retrieve ...
0
votes
0answers
395 views

Apex extension High CPU - Zulu Platform x64 Architecture [duplicate]

I experience problem with high CPU usage after every start of visual studio code. It is strictly related to apex extension. It started happening when some pop up appeared in bottom right corner. I ...
3
votes
0answers
61 views

How do I apply formatting to method descriptions in Apex / VSCode?

VSCode, when showing a tool-tip for an Apex method, will show the description of that method as defined in the fairly standard format: /** * States that the next method definition is expected to be ...
0
votes
0answers
576 views

HI All is there any way to update API version for apex classes in bulk

Is there a way to upgrade api versions of all apex classes without manually updating each of them? I have read this link and try to achieve but not able to deploy in the sandbox using the VS code. Is ...
0
votes
1answer
259 views

How delete class from Production that doesn't have code coverage

I have two classes on production org that is like a default class (supersort and TrialCustomerPortalHomePageController), but does not have code coverage at all. So because of that I'm not able to even ...
4
votes
3answers
3k views

How to see anonymous code debug logs in visual studio code?

I installed the Salesforce CLI and the Salesforce Salesforce Extension Pack on Visual Studio Code because it's easier to write code than the Developer Console but I got a problem. I want to get the ...
0
votes
0answers
735 views

VS code Package.xml not retrieving new components

I am trying to retrieve new components such as ApexClass through "sfdx retrieve source in manifest from org" on the package.xml (sample below), and it doesn't retrieve any new components ...
0
votes
1answer
57 views

Error Configure VS codespace

I am currently facing an error while configuring salesforce with VS code online We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. Here’s the error: refresh_token ...
2
votes
1answer
405 views

SFDX CLI is not working for any commands

SFDX suddenly stopped working for any commands. I updated sfdx and its plugins, still its giving same error. I am using same from VS Code, I created scratch org and performed few activities, and after ...
1
vote
1answer
364 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 ...
0
votes
1answer
380 views

VS Code Mac not Using SFDX Commands

I'm currently trying to troubleshoot something wrong with my vscode. I'm able to us Salesforce DX CLI tools in the console, but I'm not able to do it with the Command + P + >. Whenever I do this, I ...
1
vote
1answer
38 views

Viewing Apex file names in VS Code before retrieving it without using ForceCode extension

Earlier I was using ForceCode extension in VS Code. It had a nice feature to retrieve files ( Apex ) from server. You enter characters in the search box and it will show filtered list of Apex in a ...
1
vote
0answers
161 views

Unable to retrieve source after successful authorization in VSCode

I created a project with manifest. When I right click on package.xml and click 'Retrieve source', VSCode is repeatedly giving the following error even after successful authorization of the org: ERROR ...
1
vote
3answers
128 views

How to use VS Extenstion for SOQL as Introducing of Salesforce?

Salesforce just introduced Code Builder as in the link: https://developer.salesforce.com/blogs/2020/06/introducing-code-builder.html I see in the document. They are using a pro SOQL query in VS Code ...
0
votes
1answer
3k views

How to find unused variables /methods in VS Code? [closed]

In VS Code is there a way to see if variables /methods are not referenced? There are some posts like this that reference eclipse, but I couldn't find anything that's recent.
3
votes
3answers
810 views

How to get custom object in VS Code

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. I want to fetch all custom object in VS Code. How Can I achieve this?
0
votes
1answer
2k views

Error passing challenge "Deploy a Lightning web component with a reset button"

I wrote the following code and it is working fine in my playground but get this error in passing challenge. We can't find 'lightning-input' in accountFinder.html. accountFinder.Html <template> &...
0
votes
1answer
358 views

Revert changes from git using VSCode

noob question from someone who just started using VSCode and SFDX for Salesforce development. When you make changes to a project, git tracks those changes, this is nothing new. But when you want to ...
2
votes
3answers
1k views

Visual Studio Code - Developer Console

I have been trying to use Visual Studio code over the Developer Console because I understand that this will be the new standard for Salesforce however I find myself using the Developer Console with ...
1
vote
1answer
67 views

Cannot comment XML file by default in VScode (Salesforce Extension Pack)

In VS code by default language for XML file would be ForceSourceManifest (right bottom corner of the editor). You cannot comment XML code with this.
0
votes
0answers
360 views

multiple developers working on same sandbox using visual studio code

We (Team & Org.) are new in salesforce development and not sure if our infrastructure setup is right or not. Current Setup: We have a set of 3 developers working on one developer sandbox. The ...
2
votes
1answer
107 views

Tracking managed package in source control

I have a managed package that I am testing in my sandbox from the App Exchange. I am also writing some custom classes that depend on resources in this managed package. I want to track these changes in ...
0
votes
1answer
158 views

Salesforce CLI issue while creating Project [duplicate]

When I try to create project with manifest I am getting the following error: Starting SFDX: Create Project > > 10:25:36.141 sfdx force:project:create --projectname AmDev > --outputdir c:\...
3
votes
2answers
300 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
118 views

Editing/Retrieving webLinks, validationRules, EmailTemplates etc. without xml escape characters

We're moving our org metadata management to SFDX project. Ideally, none of the metadata files supposed to be edited by Salseforce UI. As an example, we are using Javascript Buttons, and "url" ...
0
votes
1answer
63 views

Apex in Vscode for Extend Keyword

I want to write a code for Extends keyword in apex using the sobject Contact.I am new to this.Can any one tell me how to run this code in vscode. When I try to run this Code, I got this error. ...
0
votes
1answer
243 views

VS Code project structure not matching IntelliJ and Repo

I joined a team who do not like to use VS code as it doesn't match the source GIT and their IntelliJ IDE's do. Is there any way to "fix" this in VScode? VS Code: Showing content under the normal ...
0
votes
1answer
155 views

For Loop Iteration in Apex

I wrote code for inserting 6 contacts on iteration basics. I got error unexpected token 'public'.Please help me, I can't find the error in this code. public class ContactHandler { public void ...
4
votes
2answers
541 views

VS Code - Snippets Library?

Before I go through and recreate all my most commonly used snippets in VS Code, does anyone know if these have been created for apex already? ..and if so where I can find them? I have checked in the ...
2
votes
1answer
29 views

Custom field still shown as "not existing" even though i have retrieved all custom object metadata

I have retrieved all custom object metadata for Account, including the referenced custom field, but vscode is still showing it as not existing.
1
vote
2answers
478 views

VS Code: display *.js-meta.xml files in the Explorer

In VS Code, I frequently need to update *.js-meta.xml files used with Lightning Web Components. By default, VS Code does not display these files in the Explorer for my Salesforce project. Is there a ...
1
vote
2answers
237 views

prettier-plugin-apex vscode printWidth not working

Started using prettier-plugin-apex and by default the printWidth is 80, I changed it to 120, but it still defaults to 80. Changed at both user and workspace level. I see this ( "prettier.": 120,) ...
1
vote
0answers
42 views

Visual Studio Code Deploy Issue

I am trying to deploy an utility class by adding a small method. The method implementation is below. public static boolean isId(String strValue) { return strValue instanceOf Id; } When I try ...
1
vote
1answer
100 views

SFDX Deploy: How to prevent accidental deploy to my Packaging Org

From VSC, I'm deploying to my Dev Org often. I'm concerned that I may be authorized to my Packaging Org and accidently deploy code there. In theory, the only deploys to Packaging Org should be from ...
3
votes
1answer
330 views

VSCODE intellisense working with SOBJECT fields, but not showing variables just created

Salesforce VSCode extension pack intelliSense seems to be working with nearly everything including intelliSense for showing all fields of SOBJECTS except it is not show variables I have just created. ...
4
votes
0answers
117 views

A folder structure that follow enterprise design patterns

I come from ASP.net background and I used to have a standardized folder structure such as this. I just jumped on a huge project with a lot of custom code. I'm sick of having to scroll through ...
3
votes
2answers
224 views

VSCode will not show context options when using scratch org

I have set up a few scratch orgs, but am running into an issue with VSCode. When connected to a "normal" developer org, I am shown various options and context menus (eg, deploy manifest etc). When I ...
1
vote
2answers
2k views

Deploying mdapi and source to org is failing with "Unexpected file found in package directory"

I'm having trouble deploying my mdapi Steps: sfdx force:mdapi:retrieve -s -r ./mdapipkg -p -- This gets the latest version of managed package from our Packaging Org -- I did not convert to the new ...
1
vote
0answers
44 views

Unable to Authorize Salesforce org using SFDX : Trailhead as it shows API is disabled

I am doing the Salesforce Trailhead Lightning Web Components. After I've created a project, I'm trying to "Authorize an org", but keep on receiving an error saying "API is disabled for this user" as ...
0
votes
1answer
1k views

Not able to create a project in vs code?SFDX: Create Project failed to run [duplicate]

This is the following error i am getting.... Starting SFDX: Create Project 11:39:05.943 sfdx force:project:create --projectname gfgfgf --outputdir c:\Users\SAMEER\Desktop\ToDoManager --template ...
1
vote
1answer
822 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 ...
0
votes
0answers
103 views

Unable to use RestContext in VSCode

I had to start using VSCode from IntelliJ (Illuminate Cloud). Surprisingly, all my services are throwing compilation errors. @HttpGet global static list<Lead_Behaviour__c> getLeadByParams() { ...
1
vote
3answers
204 views

VSCode not showing success alert

I clicked on "Show Only in Status Bar" by mistake. Now when I successfully deploy Salesforce apex code in VSCode, I only get the first alert to show the deployment is running. But the second alert ...

1 2 3
4
5
9