1

I have an object, Loan_Transaction__c, where some (but not yet all) Record Types have a translation in Translation Workbench. For example, the Record Type with DeveloperName "Payment" has label value "Payment" in English, and the translation "Pago" in Spanish in TW. The object also has a Formula Field, Record_Type__c, which returns RecordType.Name.

Screen shot

In the screen shot above, the top field ("Tipo de registro") is the built-in Record Type field available on any page layout when an object has record types. The second field is the custom field Record_Type__c. I'm not concerned about the field label; the translator hasn't entered that yet. But the field value is a formula, RecordType.Name, which should now appear in Spanish.

Same thing happens if I query the values:

select id, Record_Type__c, RecordType.name from Loan_Transaction__c where id = 'a5DW00000007P0MMAU'

That id is the same record with the "Payment" record type from the screenshot. When my language is set to Spanish, both fields return "Payment", not "Pago".

1

We can retrive the RecordType.Name translation with toLabel() as follows

select id, Record_Type__c, toLabel(RecordType.name) from Loan_Transaction__c where id = 'a5DW00000007P0MMAU'

Soql always returns the English values, but if we use the toLabel() it returns translated value.

Certainly there is no way to display translated value of a Formula field. As an alternative, instead of the Formula field we can create the Picklist Field by adding all the record types as Values & set the default value as RecordType.Name. Do the translations for the picklist values, then if we use toLabel() it returns the translated Value.
But i don't think so it would be feasible, as you need to do the dataload for the Existing records.

| improve this answer | |

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.