You are here:
Restore and Confirm Metadata for Salesforce Using Visual Studio Code
Use Visual Studio (VS) Code to restore metadata and recover changes in your Salesforce environment. Efficiently run a metadata compare job to identify added, changed, or removed metadata records. View and select changes, copy code, and deploy it back to your Salesforce org.
Restore Metadata using VS Code
-
Run a Metadata Compare job in the Own application.
You are transferred to the Jobs tab.
-
Once the Smart Metadata Compare Report has been generated, you can view which metadata
records have been added, changed, or removed, and select the appropriate column to view the
change.
The rows of code that have changed are highlighted.
- Copy the code located in between the <field> </field>tags, and paste it under the folder you created in VS for the particular object.
- Save the XML file.
-
Right click on your mouse, and from the drop-down list select SFDX: Deploy Source to
Org.
The job begins and the status is displayed at the bottom of the VS page.
Confirm Metadata is Restored
- Log in to Salesforce.
- Navigate to the Object Manager.
- Select the relevant object for the missing record.
- On the left-hand menu, click Fields & Relationships.
-
Filter by entering the relevant record name in the Quick Find.
If the metadata record has successfully been restored, you will see it here.
