Package install fails with error:
Custom Relationship Limit Exceeded
Cannot create new relationship. Each object can have no more than 40 custom relationships, including Master-Detail and Lookup.
However it is not clear which object is causing the error.
NOTE: Each object supports a maximum of 40 custom relationships (including Master-Detail and Lookup). When a package attempts to add relationships that would exceed this limit on any object, the package installation might fail.
To find the offending object(s), create a custom report type and then create a report to review existing relationships on each object in the org.
1. Create a custom report type: setup - report types - new
2. Select "Entity Definitions" as the primary object, enter label and name and description and select 'Store in Category' and select "Deployed", and click Next
3. Click "Click to relate another object", and select "Field Definitions" for B, and select "Each "A" record must have at least one related "B" record.", then save.
4. Create a new report and select above report type, use the following filters and groupings and settings:
5. Run the report, and the relationship count on each object in the org is displayed, review those on top of the report result, and compare with the metadata from the package, to find the offending objects. Eg, if Account has 10 relationships in the org, but the package has 31 relationships on Account and the org limit is 40, the error is thrown when installing the package.
6. Delete and erase some existing relationship fields on the offending objects to allow the package install to be successful.
000392956

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.