The Org Browser makes it easier to retrieve metadata sources by displaying the available metadata types and their corresponding components in the default org. We can easily retrieve metadata sources, without having to use a manifest file. The Org Browser is available only in non-scratch org such as sandboxes or dev orgs. To access the org browser click the cloud icon in the sidebar of the VS Code window. If the icon is not visible make sure your default org is set to a non-scratch org.
While the Org browser is opened, the default org metadata is saved to the local project under the .sfdx folder.
Retrieve Source for Salesforce Org Browser
Changes to the org cannot be tracked by the Org Development model, so we need to keep track of the changes we retrieve. While Retrieving a source from an org, it will overwrite the local versions of the source files. When we retrieve a source from an org, we can enable conflict detection between the org and the local metadata.
- We can retrieve the source in VS Code explorer or editor by right-clicking on a manifest file and select SFDX: Retrieve Source in Manifest from Org.
- OR by opening the Command Palette and run SFDX: Retrieve Source in Manifest from Org.
- Source File or Directory
- We can retrieve the source in VS Code explorer or editor by right-clicking a source file or a directory and select SFDX: Retrieve Source from Org.
- Select SFDX: Retrieve This Source from Org by right-clicking in the editing panel
The project structure after we retrieve the source:
│ ├── extensions.json
│ └── settings.json
| └── main
| └── default
| ├── aura
| ├── classes
| └── objects
When the code changes are deployed, the local version of the source files overwrites the metadata in the org. We could enable detecting conflicts between the local metadata and the org
We can delete sources from the project and from your non-source-tracked org.
- SFDX: Delete from Project and Org, To delete the source we can right-click a manifest, a source file, or a directory.
- If a source file opens in the editor, right-click the file and select SFDX: Delete This from Project and Org.
- We can also delete by running SFDX: Delete from Project and Org command from the Command Palette.
Leave A Comment