+ Start a Discussion
@altius_rup@altius_rup 

SOQL Internal error

This SOQL query produces an internal error :

SELECT QuotaOwner.Name nom, SUM(QuotaAmount) montant FROM ForecastingQuota GROUP BY QuotaOwner.Name

 

Anyone know why ?

Rup

Jia HuJia Hu
What is your error info?
It seems I can't access ForecastingQuota Object in Apex.
Pat PattersonPat Patterson

Not sure why it's happening, but please file a bug with the error info. A similar query that almost gets you what you want is:

 

SELECT QuotaOwnerId id, SUM(QuotaAmount) montant FROM ForecastingQuota GROUP BY QuotaOwnerId

 Then you would need to select the corresponding names for the Id's from User and correlate them in code.

@altius_rup@altius_rup

@Pat,

Thanks for your reply.

 

Indeed, ForecastingQuota is rather exotic and seems to be really half-baked :

 

This is OK :

SELECT QuotaOwnerId, StartDate, QuotaAmount FROM ForecastingQuota

 and so is this :

SELECT QuotaOwner.Name, StartDate, QuotaAmount FROM ForecastingQuota

 

 

This ORDER BY is OK :

SELECT QuotaOwnerId, StartDate, QuotaAmount FROM ForecastingQuota ORDER BY QuotaOwnerId ASC

 but this is not :

SELECT QuotaOwner.Name, StartDate, QuotaAmount FROM ForecastingQuota ORDER BY QuotaOwner.Name ASC

MALFORMED_QUERY : Implementation restriction: Sorting is allowed only on ForecastingQuota fields

 Half-baked ?  :(

 

 

This GROUP BY is OK :

SELECT QuotaOwnerId, SUM(QuotaAmount) FROM ForecastingQuota GROUP BY QuotaOwnerId

 but this one is crashes :

SELECT QuotaOwner.Name, SUM(QuotaAmount) FROM ForecastingQuota GROUP BY QuotaOwner.Name

UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1506522669-265 (-569608522)  

 

Ugghhh ! :((

 

OK, so back to APEX to work around yet another silly bug ...

 

angry Rup

Pat PattersonPat Patterson

Can't disagree with you on the bug. Please open a case so it goes onto the queue for a fix.

Sudhakar ReddySudhakar Reddy

Hi pattson,

 

How to open a case in this case?

can you please explain me?

 

Regards,

Sudharkar reddy

 

 

Pat PattersonPat Patterson

Hi Sudharkar,

 

Call Salesforce Support.

 

Cheers,


Pat