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
Gaurav Gulanjkar 14Gaurav Gulanjkar 14 

Translating the picklist values in salesforce used in wrapper class

I have a picklist field on a custom object who's values are translated using translation workbench.
In my class I am using wrapper class and displaying the picklist value on a visualforce page using "output:text component".But the translated valu is not getting rendered as I have used a wrapper class.Can any one help to find a way around for this  issue.
 
Best Answer chosen by Gaurav Gulanjkar 14
nbknbk
is your issue related to translated picklist value not showing in visual force page! How you retreive the picklist field from soql. for example
select id,picklistfield from account
select id,toLabel(picklist) from account - Use toLabel in soql statment for picklist translated values.
reference link: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xMXIAY
If you already tried this one share sample code, it will help to check the issue

 

All Answers

nbknbk
is your issue related to translated picklist value not showing in visual force page! How you retreive the picklist field from soql. for example
select id,picklistfield from account
select id,toLabel(picklist) from account - Use toLabel in soql statment for picklist translated values.
reference link: https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xMXIAY
If you already tried this one share sample code, it will help to check the issue

 
This was selected as the best answer
Gaurav Gulanjkar 14Gaurav Gulanjkar 14
Thanks @nbk the solution did worked.

Now when i am converting the picklist to checkboxes and display it on VF page it does not render the translated values insted the english values are displayed.In the query I have used toLabel.
Any clues on this?
nbknbk
Gaurav,

As per your comments, you changed the data type from Picklist to checkbox and try to use in visual force. So the check box field label showing default language in English?

for picklist data type only we are recommended to use toLabel (picklistfield) other fields we can use regularly. Let me know if you have other scnearios.

try to use outputlabel, outputext in vfp and see.
Gaurav Gulanjkar 14Gaurav Gulanjkar 14
@Nbk Thanks for the solution it worked.