4

I wanted a Metadata API to get the Spanish translations of Address Country picklist. Using Translations type or Address doesnt help me get the values.

2

Translations are always retrieved in the user language. You can see their labels and codes with this code snippet:

    Schema.DescribeFieldResult fieldResult = Account.BillingCountryCode.getDescribe();
    List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    System.debug(LoggingLevel.INFO, '>>>>> Countries');
    for( Schema.PicklistEntry f : ple) {
        System.debug(LoggingLevel.INFO, '>>>>> ' + f.getValue() + ' :: ' + f.getLabel());
    }
0

Use query SELECT id,name, toLabel(yourcountry fieldname) FROM yourobjectname and get the translated values .

sfdev

  • Thats not what I intend to do. Country Values may or may not be in a record of an object. I want to retrieve the metadata. – Pratibha UR Jul 28 '15 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.