0

There is a global value set that we need to fetch in the Apex class. There are some solutions which are using REST call to Tooling API for accessing them.

However, I want to know, is it possible to fetch GlobalValueSet in Apex without REST call?

It could be either using SOQL or some other way.

SOQL Query: SELECT Metadata FROM GlobalValueSet WHERE DeveloperName = 'Talent_Role'

GlobalValueSet

1 Answer 1

2

If your global value set is being used for a picklist, you can retrieve it by getting the picklist values for that field.

To do that you use the following:

Schema.DescribeFieldResult fieldResult = ObjectAPIName.FieldAPIName.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
0

You must log in to answer this question.

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