Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Invalid field name <xxx>" on Report metadata type
Resolving validation errors - "Invalid field name <xxx>" on Report metadata type

Possible causes and solutions to this Salesforce validation error

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated over 9 months ago

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.

Another use case 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 to that would be to 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.

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.

Did this answer your question?