[SalesForce] Managed package install failed with The first validation error encountered was “{0}”

When trying to install an update for a managed package that I created into a clients Org the install failed with the message:

The first validation error encountered was "{0}"

Problem – Validation Errors While Saving Record(s)

Detail – There were custom validation error(s) encountered while saving the affected
record(s). The first validation error encountered was "{0}".

How can I determine what caused this validation error and subsequent install failure? The detail message doesn't provide many clues.

The changes between this newest version and the previous one where mostly around the addition of new Validation Rules on Opportunity. The "{0}" in the details looks like the part where I should see some useful information, but the substitution hasn't occured.

I have raised this as a support case, but there is a 2 day wait before I get past the first level of support. I also created Package install fails – The first validation error encountered was "{0}" on the discussion boards.


Update 1

After trying to install the validation rules manually into the target Org I ran into the following error message when saving the 6th of 7 total rules in the managed package.

"The formula references fields across 11 relationships while only 10
are allowed. Please contact support at salesforce.com for more
assistance"

I had seen this before when trying to add additional validation rules in the managed package. When using the Check Syntax button I get the slightly clearer message:

"You have reached the maximum number of 10 object references on
Opportunity"

You have reached the maximum number of 10 object references on Opportunity

They have 5 formula fields already in place with related object references and the managed package I'm trying to install has 6 validation rules. If this is indeed the reason the managed package can't install then it would appear the object reference limit isn't independent in a managed package.

Best Answer

Re: "The formula references fields across 11 relationships while only 10 are allowed. Please contact support at salesforce.com for more assistance"

This is a "soft" limit, that is salesforce support has the ability to raise this limit within reason. I've seen it raised to 12 without any pushback before. I believe anything over 15 requires additional approvals from the product management team.

The limit is in the number of related object fields you are referencing. For example the formula:

myCustomLookup__r.name && account.name

would consume two "relationships" in terms of this limit as it follows the account and myCustomLookup__c fields.


After resolution notes

Some notes from the support case in the customers Org that got the limit increased after 12 hours with Premier support and several levels of esculation:

  • I need assistance with CRM
  • Product Topics Limits & Feature Activations
  • Subject Increase Spanning Relationships limit (Note that Support changed the subject to this)
  • Excerpt from Case Comments: "I am glad to inform you that the requested limit has been increased to our hardcoded maximum of 15 for your organization."