Posts

Showing posts with the label custom label

Salesforce Fact #872 | Query custom label translations

It is possible to query custom label translations using Tooling API and using the object ExternalStringLocalization. Below is a sample query: SELECT Id   ,ExternalStringId   ,ExternalString.Name   ,ExternalString.Value   ,Value   ,Language  FROM ExternalStringLocalization  ORDER BY ExternalString.MasterLabel, Language Reference:  https://salesforce.stackexchange.com/questions/357686/can-i-query-for-custom-label-translationshttps://salesforce.stackexchange.com/questions/357686/can-i-query-for-custom-label-translations

Salesforce Fact #701 | Access custom label dynamically in apex

Image
We can now access custom labels in apex dynamically. With Summer'23 release, we have a new System.Label.get() method which returns the translation of a particular custom label for a particular language. Reference:  https://help.salesforce.com/s/articleView?id=release-notes.rn_apex_system_label_methods.htm&release=244&type=5 Note: passing the namespace as blank also returned the same results. Attached are the screenshots.