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:
Head to
Rename Tabs and Labels
inSetup
.Select the same language from the
Select Language
drop down that theField Label Translation
was added on:Locate the object the translation is for under the
Custom Tabs
section, in my example this is theTranslations Object
:From the above screenshot, select
Edit
next to your object.This will open the following screen for your object:
Don't make any changes unless you want to amend the
Gender
from what is already selected.Click on
Save
.You should then see a tick against renamed on the object and an entry for last modified:
In Gearset, head back to your comparison, and select the
Full Refresh
option for your comparison filter:This will refresh all the objects in the filter.
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.
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.