Loading

Package install fails with error 'Custom Relationship Limit Exceeded'

Fecha de publicación: Oct 13, 2022
Descripción
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.

But it is not clear which object is causing the error. 
Solución
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:
  • filter by: 
Is Customizable? equals "True" AND Qualified API Name contains "__c" AND Relationship Name contains "__r" (note Qualified API Name is the field on FiieldDefinition table, same for Relationship Name)
  • Show "all entity definitions" and "Created Date" range set to "All Time"
  • Group row by Qualified API Name(note this is the field on EntityDefinition table)
  • Do not show details, but show record count 
  • Sort report result by row count descending 
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. 

 
Número del artículo de conocimiento

000392956

 
Cargando
Salesforce Help | Article