0

In VSCode I can only deploy changes from my project to the scratch org. Is it possible to do the same when VSCode is connected to the standard sandbox?

3

Yes, you can use sfdx force:source:deployand pass the username or alias of the environment to deploy to using the -u flag

  • This would deploy everything, not just modifications, right? – Phil W Aug 1 at 12:09
  • @PhilW Yep, but that's just the reality of deploying to a non-scratch org using the CLI (and, I imagine, part of the reason Salesforce encourages SFDX projects to only contain small and independently testable chunks of functionality). You can maintain a package.xml file to limit what gets deployed (using the -x flag) – Derek F Aug 1 at 12:33
  • @DerekF as I know dx push does the deployment changes only. Not all source. – Eugene Vabishchevich Aug 1 at 15:26
  • @EugeneVabishchevich I'm not talking about force:source:push, my answer covers force:source:deploy – Derek F Aug 1 at 16:28
2

Yes, it can be done. Its called as Org Development Model. Sandbox and Prod dont support dx format. They support metadata format. You can create a project with manifest and use VS code to deploy in sanboxes.

Or, convert sfdx to metadata format and then deploy.

Src: https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model

Src: https://trailhead.salesforce.com/en/content/learn/modules/org-development-model

  • Better still, use IntelliJ IDEA and Illuminated Cloud 2 instead of VSCode. You can do both without having to restructure your project code IIRC. :) – Phil W Aug 1 at 12:11
  • 1
    I use intellij, but people don't prefer as its paid? – Pranay Jaiswal Aug 1 at 12:24
  • @PhilW IntelliJ IDEA + Illuminated Cloud 2 are not free. And we want to work with standard Salesforce solutions. Right now it's VSCode + Salesforce plugin. – Eugene Vabishchevich Aug 1 at 13:56
  • 1
    You have to know the list of files to deploy then you need to set up the package.xml as @DerekF suggested - or you need to use the path specifications on the CLI. – Phil W Aug 1 at 14:07
  • 1
    @EugeneVabishchevich if you want a better developer experience and to be more productive I strongly recommend IDEA+IC2. Just because Salesforce provide their VSCode plugin doesn't mean you should slavishly stick to it IMHO. IC2 uses only standard Salesforce functionality (meta API etc.) under the hood so is fully compatible. It just happens to provide an easier to use and more productive UX. (Yes, there are cost implications, but if you are serious about Salesforce development your company should be able to stretch to it!) – Phil W Aug 1 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.