Retrieve globalpicklist/globalvalueset without SOQL

Is it possible to retrieve the values of a Global Picklist/GlobalValueSet using Schema class without a SOQL ?

Answer

My strategy here would simply be to describe a picklist field that implements the Global Picklist.

SObjectField picklistUsingGlobal = SObjectType.MyObject__c.fields.PicklistUsingGlobal__c.getSObjectField();
List<PicklistEntry> entries = picklistUsingGlobal.getDescribe().getPicklistValues();

Attribution
Source : Link , Question Author : HSG , Answer Author : NITHESH K

Leave a Comment