You may come across the Salesforce error
No more than 10 columns may be specified in lookupPhoneDialogsAdditionalFields when carrying out a validation or deployment. We've seen this occur with the Contact object.
This article explains why this error occurs and how you can get past it.
What in my metadata is causing the error?
In your Gearset comparison results, if you check the XML of the object that's failed the validation/deployment with this error, you will find that it has more than 10 lines for
lookupPhoneDialogsAdditionalFields. Here's an example:
(As shown in the screenshot above, the object may be split into two line items; in which case, check both.)
In your orgs, this corresponds to
Lookup Phone Dialogs in the
Search Layouts for Salesforce Classic tab for the object:
Salesforce are now enforcing a limit of 10 fields for a search layout. You can see this if you have an org with fewer than 10 entries in
Lookup Phone Dialogs and try to edit to have more than 10 - you get the error
Invalid data. No more than 10 fields can be added to a search layout.
How then did your org(s) get more than 10 in the first place? It may be that Salesforce didn't use to have this limit. We've previously observed that 'when adding a new phone number field to an object in Salesforce, it will automatically include it in the ‘Lookup Phone Dialogs’ search layout', so this may have added extra fields to the search layout.
Is my source or my target causing the error? Why is this object included anyway?
If your Contact object (or whichever object is failing) is showing in the Gearset comparison results as
Different, and you have selected it to deploy, then the XML from the source will be deployed to the target. In this case, review the configuration in your source.
However, if you have just selected components of Contact (such as a custom field, record type, list view or validation rule), the Contact object will be automatically brought into the deployment package. The Contact object from the target will be redeployed in the target to act as a 'container' for the component to stitch into. This is described in this support document. In that case, review the configuration in the target.
If you haven't selected the Contact object or any of its components, it may be that a Gearset problem analyzer has brought it in automatically - example shown below. Again, review the configuration in the target.
How do I fix the error?
Once you've determined whether it's the source or the target you need to edit, remove any unnecessary
lookupPhoneDialogsAdditionalFields so you get down to 10 or fewer.
As shown above, in a Salesforce org you need to go to the object in
Search Layouts for Salesforce Classic, and edit
Lookup Phone Dialogs to remove fields.