I need to get a list of available picklist fields in apex code, I attempted to get them like so:
// Products__c is a multi-select picklist custom activity field Event.Products__c.getDescribe().getPicklistValues()
And this works fine in anonymous apex execution but when I do it in my apex class, it wont compile giving me the following syntax error:
Method does not exist or incorrect signature: void getDescribe() from the type String
Why does it work fine in anonymous apex but not in my class? And how should I be getting picklist values in apex?