Salesforce Fact #701 | Access custom label dynamically in apex

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.




Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow