Skip to main content
Gabe Wonders (Github) 님이 #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개
  1. 2017년 1월 17일 오후 3: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