Created
April 1, 2016 10:34
-
-
Save swapnilshrikhande/dd2641228faa88b19fe19a46336aadd0 to your computer and use it in GitHub Desktop.
Apex : Get Label Value By API Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This method return the String value for the Label Name | |
public String getLabelString(String labelName ){ | |
Component.Apex.OutputText output = new Component.Apex.OutputText(); | |
output.expressions.value = '{!$Label.' + labelName + '}'; | |
return String.valueOf(output.value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment