Error: Not a valid enumeration for type: class com.sforce.soap.metadata.Gender
When working with Copado you might receive an email with the details below:
Error loading metadata file 'ObjectName__c-da.objectTranslation': Not a valid enumeration for type: class com.sforce.soap.metadata.Gender"
Let's analyze the error.
Broken-Xml-Files(s) -> This means one or more of your xml files in Git contains incorrect data.
What files? If you check the rest of the information in the email, you will see:
Error loading metadata file
-> This is the file that is broken in Git.
What is exactly broken? This is also provided on the error:
Not a valid enumeration for type: class com.sforce.soap.metadata.Gender -> The value in the tag Gender in the file above is incorrect.
So, now you know what file in Git is failing and why but, this file exist in different branches in your repository. In which one is the file broken? Well, it might be broken in several branches but, you can start checking the branches involved in the operation you were performing when you received the email with error.
If you were committing in a user story, check the affected file in the master branch and source branch.
If you were promoting and/or deploying, check the affected file in the feature branch, promotion branch and target branch.
How to avoid this issue in the future once all the branches have been fixed?
This commented values are retrieved by the Salesforce Metadata API, Copado is not adding any of this values.
The feature Global Find and Replace Rules
Please note that creating or editing rules and regex in this file are out of scope of Copado Support. If you need help you with such configuration, feel free to contact your Customer Success Manager to engage with our Professional Services organization who will be able to support you.
The following rules are pasted as images to avoid issues with hidden characters when using the Copy and Paste functionality.