I'm getting the following error: No such column 'NamespacePrefix' on entity 'Organization'. When trying to save a class with the following SOQL query.
Organization org = [SELECT NamespacePrefix FROM Organization];
But I am able to run this query in the Developer Console Query Editor just fine. What's the reasoning behind this?
2 réponses
My mistake, I was working on a class that was set to API Version 30. The API version needs to be 36 or higher to use the field NamespacePrefix on the Organization object.