Explanation of the error
This Salesforce validation error that Gearset is surfacing is likely to occur on the Report metadata type when you're deploying a new report to the target:
β
βInvalid field name <xxx> - where <xxx> references the name of the field that Salesforce recognises as invalid; while the field is often already deployed to (or present in) the target environment.
β
We've seen this error being usually reported during 'Compare and deploy' deployments.
Resolution
It's possible that the metadata filter used for your comparison doesn't include the Report type metadata.
β
Amend your filter to include Report type metadata type, and add the specific report type to your deployment package.
We also recommend to add the Custom field metadata type to your filter (Custom field is a part of a Custom object metadata), as it's possible there may be another field missing in the deployment package that could lead to this error.
Other cases we've seen:
What if the Report I'm deploying includes a Custom Field <xxx> that is a part of a managed package?
If the Custom Field <xxx> referenced in the Salesforce validation error is a part of a managed package - it's possible that this field isn't available in the XML file of your Report type, which you're using to deploy the Report, because the Report type was installed from a managed package.
Resolution:
Clone the Report type in your source environment, then add the missing Custom field in the Record type. This should allow you to deploy your changes.
What if the error relates to Activity Settings configuration?
One of our customers discovered that this validation error can also show if you're deploying reports that include Activity-related Custom Report Types, and the Shared Activities setting differs between your source and target orgs.
This is caused by the "Allow Users to Relate Multiple Contacts to Tasks and Events" setting in Activity Settings. When this setting is enabled in one org but not the other, deployments of Activity-related report types can fail.
Resolution:
Check the Activity Settings in both your source and target orgs (Setup > Activity Settings) and ensure the "Allow Users to Relate Multiple Contacts to Tasks and Events" setting matches.
For more details, see the Salesforce Known Issue (W-2571527).
Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.
