+ Start a Discussion

Spring 2010 Aggregate Functions Bug?

I've been trying out the aggregate functions to see how useful it will be, and I ran into an error message that concerns me. System.Exception: field 'Subject' can not be grouped in a query call Here's the code: AggregateResult[] r_array = [SELECT Subject,Count(Id) FROM Task GROUP BY Subject]; for(AggregateResult r : r_array) { System.debug(r); }

"Some object fields have a field type that does not support grouping. You can't include fields with these field types in a GROUP BY clause. The Field object associated with DescribeSObjectResult has a groupable field that defines whether you can include the field in a GROUP BY clause."




Not sure why that field wouldn't be groupable, but apparently it is not a bug.