We have been developing a managed package which we are using 2GP and scratch orgs to build. This past sprint I had no issues pulling from github, pushing to scratch and proceeding with development. This week I committed changes to github and wanted to start with a new scratch org (new sprint).

I am now getting an error when I try to push to the new scratch org (along with many others that are due to this field not deploying). The error is caused by a custom field on a custom object.

You cannot add a master-detail relationship to a managed custom object.

This field has always been a master detail so I don't know why this is all of a sudden an issue.

I even went back to a previous commit that I know has been successfully pushed in the past and it is now throwing the error.

I am happy to provide any more context here. I honestly don't really know where to begin debugging this.

EDIT: It is worth mentioning the code begin deployed is only that of our managed package. There are no dependencies on other managed packages.

EDIT 2: We did recently submit our package for security review to be listed on the app exchange. The base object is included in the submission but this field is not (to be added in a future release). Could this be the issue? Now that we are submitted, it doesn't allow us to add a master detail off of one of the objects included in the submission? If that is the case, how are we expected to add functionality and new features to our app?

1 Answer 1


After more digging it looks like my comments from EDIT 2 are true. In case anyone else is looking for resolution to this issue:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .