Skip to main content

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 个回答
  1. 2017年1月17日 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