0

Seems like the latest VS Code version is not pulling managed package components to the workspace.

I have it connected with my dev org that contains the managed package which I have released in salesforce app exchange.

Until last week I was able to use VS Code to modify apex classes and aura components from the same managed package.

I recreated the project and now I only see unmanaged components. How can I pull managed package components in VS Code? Thanks.

0

You can't pull them from the installed version, so make sure you're using the correct org. Other than that, you can just retrieve them by package name on the command line:

sfdx force:source:retrieve -p "My Package Name" -u devOrgAlias

Or through the GUI, whichever you prefer. I generally prefer a CLI.

5
  • Thanks, @sfdcfox. Just to confirm, I have connected vs code with my dev org where this managed package has been developed, i.e. I can edit the code in the package, as I am the owner. In VS Code editor, I am not seeing these managed components in the org browser (cloud icon). It used to show them until last week, so not sure what's changed. I tried the CLI, but its throwing "Unexpected file found in package directory: /Users/sidharthagarwal/Documents/vscode-workspace/FieldPro2/fpro" error Jun 22 at 1:29
  • @SidharthAgarwal Ah, it sounds like an unexpected file ended up in your FieldPro2 directory. Try using the CLI, it should give you a more precise error on which file was unexpected.
    – sfdcfox
    Jun 22 at 1:36
  • The error was from CLI only. Will try more. But do you happen to know why the org browser (cloud icon) not showing these codes? As I mentioned it used to show until last week. This was pretty easy since I could fetch only the files I care about, by just clicking on them\. Jun 22 at 1:52
  • @SidharthAgarwal not sure. Maybe check the logs? I'll see if it's working on my system, I don't use Org Browser much.
    – sfdcfox
    Jun 22 at 2:53
  • The below link explains it well. I was able to pull all package components in my VS Code. sfdx-isv.github.io/sfdx-workshop/sfdx-managed-packages/… sfdx force:mdapi:retrieve \ -u fieldpro@force.com \ -p "FieldPro" \ -r mdapi-source \ -s Also, we could use the below sample commends to pull all components, irrespective they below to a package or not sfdx force:source:retrieve -m CustomObject sfdx force:source:retrieve -m ApexClass sfdx force:source:retrieve -m ApexPage Jun 22 at 19:53

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.