For Custom Metadata Type records we treat these as metadata rather than data for data backup jobs. This means that the information stored for a Custom Metadata Type record is stored as part of the metadata snapshot rather than in the other objects you may see like Account
, and Opportunity
.
Changes to Custom Metadata types will not be shown in the New/Changed/Deleted within your backup job, but you will be able to see changes if you go to Use snapshot
then Restore
metadata for a backup run previous to any changes.
β
If you would like to see the details of the changes and be notified of them, we recommend that you set up a Monitoring job for the Custom metadata
(details below).
Example
I have a Custom metadata type called DemoType
which has two fields, a text label DemoGroup
and a checkbox IsPublic
:
This initially has 4 types: DreamforceDemo
, Internal Dev Demo
, InternalDemo
, WebinarDemo
.
There are some changes made:
- An Internal Sales Demo
type was added.
- Internal Dev Demo
has the DemoGroup changed from "Developers at Gearset" to "Developers and Ops at Gearset".
- The WebinarDemo
type was deleted.
I then run my data backup job, but no changes are picked up. However, if I click on Restore
metadata for the backup run before this change happened:
β
This will run a comparison of the metadata for with the backup run before the changes occurred, and I can see it picked up:
- The change for Internal Dev Demo
- The deleted WebinarDemo
which exists in the backup, but does not exist in the org (so it is shown in New
)
- The newly added Internal_Sales_Demo
which did not exist in the old backup run but exists in the org
If I want to restore the WebinarDemo
, I select the item and click next:
I can then add some notes, and deploy this back to the org:
Once you click Deploy Now
, we will push the change to your org. Once deployed, the deleted type WebinarDemo
should show correctly back in your Salesforce org:
Creating a Metadata Monitoring Job
The recommended way of monitoring custom metadata type changes is to set up a Monitoring job in Gearset. Go to https://app.gearset.com/change-alerts or Monitoring
in the sidebar, under Automation
:
Click ADD NEW JOB...
to bring up the dialog. We can select Custom metadata
in the Metadata filter
:
Using the same example as above, we note that the changes to the DemoType
is picked up as "Different":
If we View History
we can see the changes made are picked up as Changed / New / Deleted
items:
We can then select View Comparison
to see more details which should align with what we saw in the aforementioned example:
- We see the change to Internal Dev Demo
under Changed Items
.
- The newly added Internal Sales Demo
type is under New Items
.
- The deleted WebinarDemo
type appears under Deleted Items
.
If you would like to revert these changes, you can kick off a Roll back comparison
by clicking View History
, then clicking Rollback
.
β
This will then start a comparison with the saved Metadata backup and your org. You can then deploy any changes back to your org in the same way as described above.
If you have any further questions, get in contact with the team via the chat!