Retrieve Salesforce Metadata into VS Code
Steps:
- Open VS Code with SFDX extensions installed
- Set up a new project folder
a. HitCtrl-Shift-P
on Windows orCmd-Shift-P
on Mac
b. Run command:SFDX: Create Project with Manifest
c. Select Standard
d. Choose a name for the project folder and place it in a convenient location - Authenticate into your org
a. HitCtrl-Shift-P
on Windows orCmd-Shift-P
on Mac
b. Run command:SFDX: Authorize an Org
c. Choose Production for production and Trailhead orgs, Sandbox for sandbox orgs
d. Select a name for the org or accept the default
e. Enter your credentials to the org
f. Grant access to “Salesforce CLI” when prompted - Select the metadata to retrieve
a. Click the Cloud icon in VS Code, the “Org Browser”
b. If necessary, click the “Refresh” icon
c. Select the metadata type you want to retrieve, for example,Apex Classes
d. Click the small cloud icon next to that metadata type
e. If you get an error, try re-launching VS Code
f. After the retrieve operation successfully completes, switch back to the File Explorer
Done - now you can edit the metadata locally and deploy back to the org by right-clicking the component, then selecting SFDX: Deploy Source to Org