I'm working on combining several orgs into a single org. As part of my requirements, until the process is complete, I created some code that syncs up data from the "primary" org back into 3 "legacy" orgs.

This process has me regularly writing, updating and maintaining code in 4 different orgs.

In VSCode with SFDX I created 4 separate projects. The problem is, when I switch from one to the other, there is an time sink from closing down one project an opening another. Futhermore, this forces me to close all of my files for a given project when I would like to have multiple files from multiple orgs open at once.

I created a workspace to try to get all of my projects into a single window where I could work in all my orgs as needed. The problem is that the SFDC CLI seems to only want to work for one of the projects. When trying to deploy or retrieve code from the other 3, it gives me errors.

Is there a way to configure VSCode and the SFDX plugin to allow me to have multiple, functioning, projects in a single workspace?

  • As far as I'm aware, no, VS Code doesn't yet have an extension like this (maybe someone will write one some day). For now, you'd probably want to use shell scripts.
    – sfdcfox
    Mar 15 '19 at 16:40
  • The problem doesn't necessarily seem to be on the VS Code side, it has support for workspaces and multiple projects. It feels more like an SFDX plugin issue. Seems that it just grabs the first project it can find and uses that information as opposed to being able to identify which project a file belongs to.
    – gNerb
    Mar 15 '19 at 16:43
  • Actually, it's based on the sfdx-config.json file; that file requires modification to work with different paths, which often makes it impractical.
    – sfdcfox
    Mar 15 '19 at 16:45
  • Yea I was reading up on that, it seemed that it was still only meant for a single project though. It's designed to support what ever this "second generation packaging" stuff is. Seems to be super helpful for ISVs and agile minded companies. I am likely to implement it, just doesn't seem related to this issue.
    – gNerb
    Mar 15 '19 at 16:51

Reviving this post to point out that this is now possible.

In fact, you only have to Authorize each org once, and they will be available in every future project you create.

So now my (quick) deployment workflow is:

  1. Make package.xml
  2. Set my Dev box as my Default Org (see image)
  3. Right-click: Retrieve Manifest from Org
  4. Set my SIT, UAT, Prod as my Default Org
  5. Right-click: Deploy Manifest

the red lines each represent Orgs I have authorized in this or any other project


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.