[SalesForce] How to retrieve all files in VS Code

I'm working on the Apex Specialist super badge on the Salesforce Trailhead. I'm also trying to get more comfortable with Visual Studio Code with the Salesforce extensions.

I've successfully create a project and connected it to the playground organization. I then tried to get the source code by executing SFDX: Retrieve Source in Manifest from Org, and it did get two files I created (a class and its metadata xml file), but not everything.

The super badge project provides an unlocked package that I installed into the org. Part of this package were template files for classes and triggers. The exercise expects us to edit this files, and I have done so to some extent, but these files weren't retrieved.

How do I get all the files onto my local machine for editing?

Best Answer

As the command says retrieve source in Manifest from org, that's the trick it only retrieves whats configured or specified in manifest, go to the sfdx project folder inside it you will find a manifest folder , inside it a file named package.xml this is where its specified what to retrieve from the org

A sample manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>SampleClass</members>
        <members>SampleTestClass</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexComponent</name>
    </types>
    <types>
        <members>InvoiceTemplate</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTestSuite</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <types>
        <members>Checkbox</members>
        <members>Logo</members>
        <members>Signature</members>
        <name>StaticResource</name>
    </types>
    <version>46.0</version>
</Package>

As you can see inside types the name specifies the type of metadata I want to pull and members contain the names of the resources Do this trailhead module to get a idea:

https://trailhead.salesforce.com/en/content/learn/v/modules/package-xml/package-xml-manifest

Recently you will find sfdx projects in Vscode have org browser, you can use this to click pull the data if you don't want to go through the hassle of manifest(It works on the default org)

https://developer.salesforce.com/tools/vscode/en/user-guide/org-browser/

Related Topic