9

Is there any way to get all custom labels in an org?

Say I have something like this in a controller

public Map<String,String> getCustomLabels() {

    customLabels = [get all labels]

    return customLabels
}

or is there a method to get them through a SOQL query?

1 Answer 1

9

Custom labels are not accessible via SOQL. You will need to use the Metadata API to complete the query you are looking for.

I would suggest taking a look at Andrew Fawcett's Apex Wrapper Salesforce Metadata API.

With the API you can query the CustomLabels metadata type to get the information you are looking for.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .