3

I have started using Visual Studio Code and I've run into an issue when trying to retrieve newly added metadata. I've created my project and connected to my development sandbox org and retrieved all the metadata defined in the package.xml file. I can deploy and retrieve all the existing metadata in the project...i.e. classes, visualforce pages, aura components, etc. However, if a new class was added to the org by another developer, I cannot seem to pull it down into my project. I've tried ctrl + shift + p >> retrieve this source from org, but it only refreshes the existing metadata I already have it my project. How do you pull down newly added metadata? What is the terminal command to retrieve new metadata?

Also, I might be missing something, but how can you search across all your project folders? When I run searches, it only searches within the current project folder that is open. In Eclipse I could search across all workspaces for a piece of code that I had written in another project. Is there a way to do this in Visual Studio Code. I would assume there is and I just haven't found the way to do it. Can anyone point me to how to search across all project folders?

2 Answers 2

2

When using the Org Development Model, Visual Studio Code only synchronizes the metadata that's requested in your package.xml:

If you want to retrieve a new Apex class, add that class (or all Apex classes) to a package.xml file and retrieve your source using the manifest file.

This is because sandboxes don't come with the Source Tracking feature that allows Salesforce DX to know which metadata components have been updated locally and on the server.

how can you search across all your project folders?

Visual Studio Code searches the folders you have open in your workspace. If you want to include a folder, you need to add it to the current workspace; folders that aren't shown in the browser on the left side of your window aren't searched.

1
  • Thank you @David Reed!!!
    – Dman100
    May 20, 2019 at 16:12
3

How do you pull down newly added metadata? What is the terminal command to retrieve new metadata?

sfdx force:source:retrieve -m ApexClass:MyApexClass

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.