function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jhartjhart 

EE org getting "Aggregate query not allowed in this organization" error

We recently re-tooled some of our queries to use the new "group by" syntax.

 

However, for one of our customers, we're getting this error:

 

Apex script unhandled exception by user/organization: ..../....

Visualforce Page: /apex/i__aalogged

caused by: System.Exception: Aggregate query not allowed in this organization

 


 

I confirmed with the customer that they are an EE org.  What is causing this?  I wasn't aware that "group by" wasn't allowed in certain orgs.

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

This should be resolved now.

All Answers

MiddhaMiddha
Can you confirm if you are using the 18 API version for your class/trigger. In Eclipse you can change the api version from the class XML by updating the entry to <apiVersion>18.0</apiVersion>.
jhartjhart

Yes, the class that includes the aggregate query is apiVersion 18  (I wouldn't have been able to compile it otherwise, no?)

 

The exact same code is running on many other client orgs with no problem; we have seen this error only for one org.

 

Salesforce support  - I have created case 03427309 to track this issue; the client org ID is in the case notes.

 

 

jhartjhart

This has struck a 2nd org, now, out of a couple dozen running the latest version.

 

Salesforce, any help would be greatly appreciated.

jhartjhart

Salesforce support has queried the org IDs and finds that they are PE, not EE, so I was misinformed by my customer. 

 

Soo ... aggregate queries aren't allowed in PE orgs?  I don't see this in the docs but I'm not necessarily looking in the right place.

 

 

 

Note the PDF of the Force.com Web Services API Developer's Guide (api version 18.0) has a couple dead links in this regard; it points at:

 

http://www.salesforce.com/us/developer/docs/api/index_csh.htm#sforce_api_calls_soql_select_groupby.htm

 

and

 

http://sites.force.com/ideaexchange/ideaview?c=09a30000000d9xt&id=08730000000brkn

 

neither of which are working URLs.

 

 

jhartjhart

Ah, this limitation is disclosed in the Spring '10 release notes ("SOQL Enhancements available in DE, EE, UE " )

 

[ edit - see below - this limitation isn't supposed to apply to managed partner packages ]

vasuvasu

Hi All,

 

I have 2 different Enter Prise Edition

 

AggregateResult not working in One EnterPrise Edition,

In Another Enter Prise Edition working AggregateResult Function Object ,

 

Y it show lilke ,Any Idea

 

Thanks

Vasu

SuperfellSuperfell

We're investigating this, as it was intended that everyone with apex or api access should be able to use soql aggregates.

jhartjhart

Simon,

 

Can you elaborate on that?  For example, we have a managed package that is certified, we have a partner token for API access calls, etc.

 

Should aggregate queries therefore be allowed from within our managed package when running in a PE org?

 

thanks,

john

SuperfellSuperfell

That's the intent yes, we're looking into why that's not actually the case for some customers.

jhartjhart

Great news, thank you.

Mark SFMark SF

@jhart: I will update the Spring '10 Release Notes to remove the incorrect note that SOQL Enhancements are only available in Enterprise, Unlimited, and Developer Editions. Apologies for the confusion.

 

The broken links you reported are due to case sensitivity.Try:

http://www.salesforce.com/us/developer/docs/api/index_CSH.htm#sforce_api_calls_soql_select_groupby.htm

instead of:

http://www.salesforce.com/us/developer/docs/api/index_csh.htm#sforce_api_calls_soql_select_groupby.h tm

 

and

http://sites.force.com/ideaexchange/ideaView?c=09a30000000D9xt&id=08730000000BrKN

instead of:

http://sites.force.com/ideaexchange/ideaview?c=09a30000000d9xt&id=08730000000brkn

hemmhemm
A newly certified app of mine is having this same issue. I had successfully installed the app into a demo pe org, but a customer of mine cannot. Simon, I can get you specific org info if you need it.
hemmhemm

I have been told this will be fixed in Summer 10.

SuperfellSuperfell

We're trying to get this resolved sooner than that, possibly by the end of this week.

SuperfellSuperfell

This should be resolved now.

This was selected as the best answer
hemmhemm

Excellent, thanks! Makes a big difference to not have to wait for Summer 10.

jhartjhart

Simon,

 

That's great news, thanks.

 

Can you give us any insight into the bug & its fix?

 

Some details into the inner workings might be helpful to disclose - the better your partners know the platform, the better it will be for all of us.

 

thanks,

john