Hot answers tagged

31

Before answering Keith's specific questions, I'd like to set the stage by describing the fundamentals of Salesforce DX "Projects", "Package Directories", and the "Default Package Directory". IMPORTANT: If you don't need (or want) to read the "fundamentals" info, just scroll down to the bottom third of this answer. I've got Keith's questions blockquoted ...


18

There are explicit details on the steps required for this in How do I configure the version of Java that the Apex Language Server uses? By default, VS Code attempts to locate your local Java installation by looking for a JAVA_HOME or JDK_HOME environment variable on your computer. If VS Code cannot find your Java installation, or if you want it to use a ...


12

You are most likely encountering ESLint errors in VS Code. As an example below is how my code looks like with those warnings. However I am still able to save the component and utilize alert or console.log statements specifically for debugging purposes. Your options are: Just ignore those warnings You can choose to suppress those warnings by right ...


10

UPDATE Just got an update that the Spring '19 pre-release signup link is now live. You can access it on this link. You are getting this error because the LWC project expects a version 45.0 (Spring '19 pre-release org), whereas the current DE sandboxes are still on version 44.0 (Winter '19). You will need to signup for the Spring '19 pre-release DE Org to ...


7

Looks like this is a well known issue with the Salesforce vscode extension and Salesforce is working to fix this . You can track down here https://github.com/forcedotcom/salesforcedx-vscode/issues/968


7

Looks like I have found already a culprit here. It is very important to check sourceApiVersion property of project.json configuration. Looks like this value was 44.0 in my project. Probably because I have created it before updating the salesforce-cli tool. Then I updated the CLI and even reinstalled it but the project version has not been changed. { "...


6

You have two choices. First, you can use force:package commands to create an unlocked package. You can install this in production with force:package:install; it is similar to installing an AppExchange package. Otherwise, you would need to use force:source:convert to get a mdapi style format, then use force:mdapi:deploy with the relevant test level (e.g. ...


6

There's a handy video you can watch on Getting Started in VS Code with Salesforce DX. Getting Started First things first: it's important to note that VS Code places extension prompts at the very top of the screen, instead of the more usual center of the screen. You'll need to pay attention to these dialogs, which are not immediately obvious. Once you get ...


6

Salesforce has made clear that their direction for future improvement and development of their toolchain is Salesforce DX. That doesn't mean, however, that you cannot use the more traditional Salesforce toolchain through a variety of avenues. It's probably useful to make a distinction in terminology here. The sfdx command line tool is one piece, and the Dev ...


6

Based on the webinar mentioned in the comment, breaking the components out into multiple folders that have meaningful names is the way to go. For example, they suggest using the managed package namespace prefix as one of the root folders in the nominated package directory. Didn't see any explicit mention of single or multiple package directories: probably ...


6

There is no confirm prompt currently provided . I would suggest you can open a feature request on the repository here


5

Installing DX won't prevent you from using MavensMate with VSCode. I've installed the following extensions to VSCode: Apex Code Editor for Visual Studio Code Apex Debugger for Visual Studio Code Lightning Component Code Editor for Visual Studio Code mavensmate Salesforce CLI integration for Visual Studio Code Salesforce Extensions for VS Code VisualForce ...


5

You can use MavensMate-VisualStudioCode, but it involves installing MavensMate. You might also search the Marketplace for other Salesforce-related extensions; many of them do not use DX, and at least a few appear to be completely native with no extra extensions or software required. Also, just in case I've misunderstood your question, DX works on all orgs ...


5

That's similar to what we do now and... no, it doesn't work, at least not well. If you do this, you will continue to make more work for yourself, and you will likely "never" get in to DX format. Conversion on any non-trivial project "all-at-once" is not trivial and not recommended. I tried once in our org and lost a month worth of work-hours trying to do ...


5

You need to use the force:source:deploy command (not available in the UI, as far as I can tell). The basic syntax is as follows: sfdx force:source:deploy -p source-dir/ -u username-or-alias This should work fine from any terminal you open in VS Code.


5

Can we use metadata format (src folder) with vscode, if yes than how? You can, but that means dealing with a package.xml and stuff that you've been dealing with, and using terminal commands or writing your own extension(s). VS Code is an IDE, but depends on SFDX for its commands, which do not all have an GUI option yet. So, you could develop in src, but you'...


5

In VS Code in your DX project, try clicking the three horizontal lines icon in the bottom status bar. If you have all the configurations setup correctly (which from your post, it looks like you do), clicking it from to should work


4

The ability to integrate the SFDX VS Code extension with traditional sandboxes and dev orgs was just announced (in Preview mode). More info here I've got this up and running now, but am still looking for a way to get auto-push to sandbox on save, like the current MavensMate workflow. UPDATE: To log in to a sandbox, update the .sfdx/sfdx-project.json file ...


4

This seems to be a bug in the salesforce vscode extension and you should outline the problem in the open source project here I got around some of these problems by creating my own extension which seems to work for me .I open sourced and made it available here.Feel free to use it along with salesforce extension .


4

Make sure that you have the most updated CLI version. On your terminal or command line use this: sfdx force:source:delete -p <path-to-the-component-folder-on-your-machine> It will ask you if you are sure, type y. And there you are.


4

Like with any terminal command, I do not believe there is a way to see a loading indicator. Some commands like sfdx force:package:install or sfdx force:mdapi:deploy will provide continuous status feedback in terminal: The Salesforce CLI Integration for VS Code provides a status notification and additional details in the Output panel when clicking on buttons ...


3

There appear to be two separate issues here: SFDX must be in your PATH environment variable. That is, the full path of the bin subdirectory where the sfdx executable lives. You'll likely need to relaunch your terminal and/or Visual Studio Code to get them to observe any changes you've made to your Windows PATH. You need to quote any file and directory path ...


3

It can be done by using the Edit menu and the options in VSCode. Just navigate to the folder and perform the operation there. You can always perform such operation in any standard editor, viz., Notepad++.


3

You're missing a configuration file for some reason. Try the following. Close all files and folders in Visual Studio Code, then close it entirely. Create a new folder in your project directory called .vscode. Windows Explorer won't let you do this, so do it from a terminal: mkdir ".vscode" Go in to this folder and create a new file called settings.json. ...


3

Your approach looks correct to me AFAIK. Now we can use SFDX with development orgs as well so if you want you can skip the scratch org part else everythings look good. I suggest you check this trail. https://trailhead.salesforce.com/content/learn/trails/sfdx_get_started In this trail Salesforce shared step by steps of how we can setup the SFDX with existing ...


3

No, but you can use the Apex Replay Debugger from the Salesforce Extension Pack to use a replay mechanism. The Apex Interactive Debugger requires an Apex Debugger license in your Dev Hub when debugging Scratch Orgs, or can be used by ISV to debug subscribers' Sandboxes. The Replay Debugger uses the logs generated from a transaction to simulate running ...


3

Oh, I know the answer. You have to create a project first. Then and only then the other commands will become available for you Well, yeah. That's the answer. But just to make it cleaner for you. All the commands, that exists in the palette works with scratch orgs, which can't be used outside a project, because of project-scratch-org.json file, that defines ...


3

The problem is that your sfdx-project.json file isn't a source file that can be retrieved. You'll need to select something valid to retrieve. This can be a particular metadata file (e.g., a specific class file to retrieve just that class), a folder (e.g., the classes folder to retrieve all classes in the folder) or a manifest (package.xml file).


3

I don't think this option was available when you asked the question, but you can now use "Salesforce Extensions for VS Code" and sfdx with sandboxes. I've set up several sandboxes (and production) using: "sfdx force:project:create" with parms for each sandbox & production "sfdx force:auth:web:login" to authenticate each project & set default ...


3

Salesforce is still working on this feature and I see this part of the release PR shortly .Good news !!! However note that it will still use the Metadata API deployment which is not bad but takes time .Seems like Salesforce will fix this and improve the performance under the hood . However you should be able to use the vscode extension I personally built ...


Only top voted, non community-wiki answers of a minimum length are eligible