Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
Created April 1, 2016 10:34
Show Gist options
  • Save swapnilshrikhande/dd2641228faa88b19fe19a46336aadd0 to your computer and use it in GitHub Desktop.
Save swapnilshrikhande/dd2641228faa88b19fe19a46336aadd0 to your computer and use it in GitHub Desktop.
Apex : Get Label Value By API Name
//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