function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike MinakovMike Minakov 

Translate Picklist Value in different Language

Dear colleagues,

I'm building Integration with Siebel throught Web Services and getting an error with Picklist values language.

In Salesforce the Master Value of picklists is in English. User default language is also English.

But in our Siebel the only one Language installed is German.

We have translated all the Picklists in German via Translation Workbench in Salesforce, but how can I get the German value of Picklist from APEX by SOAP Message generation?

toLabel() will not help, because it returns the picklist value in default user language, which is english.

Is there something like toLabel('German') in Salesforce?

Something to get picklist value for given language independend of default language?

Best regards,

Mikhail

Platy ITPlaty IT

Mikhail,

 

I've looked into similar solutions myself and to my knowledge the translation only happens if the user's language is set, there's no way to "force" it.  Couldn't you set the Language of the User making those Web Service calls to German though?

 

Jessie

Jia HuJia Hu
Apex or Soap API query the database layer and translation happens in the user interface layer.

Then no matter the users' language setting, in the program, you should use the English value to query the Picklist. Since in default the input of Picklist is in English.
Mike MinakovMike Minakov

Colleages, thank you for reply.

 

Jessie, change the default language for user will be a solution, I have thinking about too. But I hoped, there is another solution.

 

Jia Hu, could you please clarify, what you are ment?

I have the folowing query

Contact con = [select Department_intern__c from Contact where id = :Id ];

 Here Department_intern__c  is a picklist. I'm getting the value 'Marketing' , but I need to get german translation of this 'Geschäftsleitung' in spite of default language is english.

I need something like

Contact con = [select ToLabel(Department_intern__c,'German') from Contact where id = :Id ];

Is it possible?

 

Best regards,

Mike