Friday, July 20, 2018

How to Check Custom Labels Values Using SOQL


Custom labels are custom text values that can be accessed from Apex classes, Visualforce pages, or Lightning components. The values can be translated into any language Salesforce supports.
If you want to create Custom Labels in your Org,

  • First, check Custom Label already exists or not based on your value to avoid duplicate Custom Labels in Org.
  • If you want to refer Label in apex class 
  • System.Label.Label_Name
  • In VisualForce pages and Lightning Components use the global variable
  • $Label
In order to check the Custom Labels in org write the following SOQL Query.
Note: Use Tooling API to Query
if you are using Developer Console, check the screenshot to select Tooling API.








Demo:
Select Id, Name FROM CustomLabel WHERE Value = '<your Value>'

Check the screenshot for more information about the result.

No comments:

Post a Comment