Through the metadata API it is possible to query the translations of a Picklist field.
In our scenario the relevant objects are Lead and Contact.
We were able to get the translations except for the Salutation.
The Salutation is not part of the result set.
As you can see on the “Leads Fields” page, the Picklist "Salutation" seems to be somehow in a hierarchy with the "name" field.
Is this relevant for the query?
As far as I know the only Compound data types are Address and Location...
Here is the code we use to query the metadata API:
MetadataConnection connection = createMetadataConnection( USER, PASS );
ReadResult result = connection.readMetadata( "CustomObjectTranslation", new String[] { "Lead-de" } );
for( Metadata data : result.getRecords() )
{
CustomObjectTranslation objectTranslation = (CustomObjectTranslation)data;
for( CustomFieldTranslation fieldTranslation : objectTranslation.getFields() )
{
if( fieldTranslation.getPicklistValues().length > 0 )
{
System.out.println( "Field: " + fieldTranslation.getName() );
for( PicklistValueTranslation value : fieldTranslation.getPicklistValues() )
System.out.println( " " + value.getMasterLabel() + " -> " + value.getTranslation() );
}
}
}
The outcome (short version)
Field: Rating
Cold -> Kalt
Hot -> Heiß
Warm -> Warm
But there is nothing in the result set for the "Salutation". Is it possible that it is impossible to get the translations for the "Salutation" via the metadata API?
Thanks