Skip to main content
Gabe Wonders (Github) ha fatto una domanda in #Apex

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 risposte
  1. 17 gen 2017, 15:56
    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. 
0/9000