Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Error parsing file: ' ' is not a valid value for the enum 'Gender'"
Resolving validation errors - "Error parsing file: ' ' is not a valid value for the enum 'Gender'"

Cause and solution to this Salesforce validation error.

Vincent Maltby avatar
Written by Vincent Maltby
Updated over 3 months ago

Error Overview

When deploying a Custom object translation with Gearset to a target org, Salesforce may surface a validation error of Error parsing file: ' ' is not a valid value for the enum 'Gender':

Error Explanation

In Salesforce, when adding a Field Label Translation to a Master Field Label Salesforce creates a Gender field in the background for languages where a gender can be assigned to words, such as French and German.

In this example, I have added the below to my Translation Object in the Translate section of Setup in Salesforce:

When we look at this metadata in a comparison in Gearset we see the below:

The gender field is there, but Salesforce has added this as a commented out field.

If you then try and deploy this, you see the error Error parsing file: ' ' is not a valid value for the enum 'Gender':

Resolution

To be able to deploy your Custom object translation we need to make the gender field a non blank field.

The easiest way we have found to do this in Salesforce is:

  1. Head to Rename Tabs and Labels in Setup.

  2. Select the same language from the Select Language drop down that the Field Label Translation was added on:

  3. Locate the object the translation is for under the Custom Tabs section, in my example this is the Translations Object:

  4. From the above screenshot, select Edit next to your object.

  5. This will open the following screen for your object:

  6. Don't make any changes unless you want to amend the Gender from what is already selected.

  7. Click on Save.

  8. You should then see a tick against renamed on the object and an entry for last modified:

  9. In Gearset, head back to your comparison, and select the Full Refresh option for your comparison filter:

  10. This will refresh all the objects in the filter.

  11. You will then see on your object in the comparison the gender is now no longer commented out:

    Make sure to double check the object still contains all your expected changes and is as expected before proceeding with the deployment.

  12. When validating the deployment, this is now successful:

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?