All Collections
Problem analyzers
Master-detail relationships
Master-detail relationships
Jason Mann avatar
Written by Jason Mann
Updated over a week ago

This analyzer helps resolve issues with deploying master-detail relationships that can cause deployments to fail.

What triggers this problem analyzer?

Selecting any fields in your deployment package that have a master-detail relationship will trigger this analyzer.

If any issues are detected, you'll see a message in Gearset stating "Items requiring the master-detail field be added".

What problem is it solving?

There is a known bug in the Salesforce metadata API relating to master-detail fields.

When making changes (this does not apply to adding new metadata, just changes) to objects with master-detail fields, all the master-detail fields must always be included in the deployment, even if they haven't changed. This is despite the API documentation stating that only modified fields need to be included. 

If you don't do this, you'll see a validation failure from Salesforce along the lines of: "Cannot set sharingModel to ControlledByParent on a CustomObject without a MasterDetail relationship field".

Adding the master-detail field, or the parent object if it isn't already in the deployment, will make the deployment more likely to succeed.

How does it work?

Gearset will automatically include any master-detail fields in your deployment package, even if they are unchanged.

Did this answer your question?