You need to sign in to do that
Don't have an account?
Record Type Name Not Translated in outputText
I've got a visualforce page the is outputting a data table with a list of accounts in the account hierarchy. One of the columns displayed is the account record type. We have translated the record type values in the translation workbench and they display correctly translated on the standard acccount page layout. However, when we try to render them in a dataTable, they show the English values when a non-English user is logged in. Anyone have any good workarounds for this? Here is the code we are using:
<apex:column > <apex:facet name="header">{!$ObjectType.Account.Fields.Type.Label</apex:facet> <apex:outputText style="{!IF(pos.currentNode,'font-weight: bold;','')}" value="{!pos.account.RecordType.Name}" /> </apex:column>
Ok, here is how we were able to resolve this issue. To clarify, our solution is using a Visualforce component to render a list of accounts with their record type values in a tree view within a Visualforce page.
Within the controller class that retrieves the Account data for the Visualforce component, we wrapped a toLabel() around the RecordType.Name field within our SOQL query:
SELECT Name, toLabel(RecordType.Name) FROM Account
This is documented in the API developer guide toLabel. Record type values now display translated for our non-English speaking end users.
All Answers
Hi,
To change Record Type Name you have to goto App Setup --> Customize --> Tab Names and Labels --> Rename Tabs and Labels..
Here Select the Language you want to translate and then select the object from the list. Click on edit and there you can see the record name, translate this field with the appropriate value and save.
The solution you propose is for changing the Record Type field label. I am referring to the actual record type values themselves, which are translated in the translation workbench.
Ok, here is how we were able to resolve this issue. To clarify, our solution is using a Visualforce component to render a list of accounts with their record type values in a tree view within a Visualforce page.
Within the controller class that retrieves the Account data for the Visualforce component, we wrapped a toLabel() around the RecordType.Name field within our SOQL query:
SELECT Name, toLabel(RecordType.Name) FROM Account
This is documented in the API developer guide toLabel. Record type values now display translated for our non-English speaking end users.
Thanks for the solution. However, I tried it but I don't know why it is not working out for me. It is displaying the translation for the default language only i.e. English.
Any guesses for this issue?
Thanks in advance.