Learn how the metadata and data deployment feature in DX Inspector resolves metadata and data dependencies and preserves record relationships, using a sample app.
Required Editions
| Available in: Lightning Experience |
| Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions |
Consider a scenario where you’re building an app to manage and track projects. You’ve created these metadata components and data records in your sandbox and are ready to deploy them.
Project__c(metadata and data): The custom object (metadata) and its parent records (data).Project_Milestone__c(data): The detail records (child records) associated with the project.Due_Date__c(metadata): A custom field on theProject_Milestone__cobject.MilestoneAlert.trigger(metadata): Apex code that references theDue_Date__cfield.
Metadata and Data Relationships
Here’s a look at the metadata and data relationships in your sandbox.
- Metadata-to-metadata dependencies:
MilestoneAlert.triggerdepends on theDue_Date__cfield. If you select the trigger, the feature automatically preselects the field. - Data-to-data dependencies: To maintain the master-detail relationship, the feature deploys
the parent
Project__crecords before the childProject_Milestone__crecords. This action makes sure that the new record IDs map correctly in the target org. - Data-to-metadata dependencies: The
Project__ccustom object must exist in the target org so the feature can migrate the associatedProject__crecords.
Deployment Consistency
The metadata and data deployment feature scans metadata-to-metadata and data-to-data relationships in your sandbox. Here’s how the feature maintains metadata and data consistency during deployment.
For detailed steps, see Deploy Metadata and Data to a Target Org.
- If you select the
Due_Date__cfield, the metadata and data deployment feature detects and preselectsMilestoneAlert.trigger. - If you select the
Project_Milestone__cobject, the feature preselects the parentProject__cobject. You can configure and narrow the set of records by selecting a unique external ID and applying filters. - During deployment, the metadata and data deployment feature creates the metadata structure (field and trigger) in the target org first. Then, it migrates the records while maintaining the parent-child relationships.