• Joel CHADET
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi, 

In the controller class of a lightning component, I have this following group by query :
 
SELECT CALENDAR_YEAR(Transaction_Date__c) year,CALENDAR_MONTH(Transaction_Date__c) gbfield, SUM(Net_Net_Sales_EUR__c) amount FROM Sales_Reporting__c
WHERE Transaction_Date__c IN (LAST_N_FISCAL_YEARS:1,THIS_FISCAL_YEAR)
AND Sold_To__r.Country__r.Id ='a4O0L000000QJsKUAW' group by CALENDAR_YEAR(Transaction_Date__c),CALENDAR_MONTH(Transaction_Date__c)
ORDER BY CALENDAR_MONTH(Transaction_Date__c)

In developer console it returns 33 rows.
When i try to run my component i have this error message : 

FATAL_ERROR System.LimitException: Too many query rows: 50001
Number of SOQL queries: 1 out of 100
number of query rows: 139180 out of 50000 *******

My query cannot be more filtered, my component use Chart.js to display Chart, so all the 139180 rows are needed.

Any suggestion ?
Hi, 

In the controller class of a lightning component, I have this following group by query :
 
SELECT CALENDAR_YEAR(Transaction_Date__c) year,CALENDAR_MONTH(Transaction_Date__c) gbfield, SUM(Net_Net_Sales_EUR__c) amount FROM Sales_Reporting__c
WHERE Transaction_Date__c IN (LAST_N_FISCAL_YEARS:1,THIS_FISCAL_YEAR)
AND Sold_To__r.Country__r.Id ='a4O0L000000QJsKUAW' group by CALENDAR_YEAR(Transaction_Date__c),CALENDAR_MONTH(Transaction_Date__c)
ORDER BY CALENDAR_MONTH(Transaction_Date__c)

In developer console it returns 33 rows.
When i try to run my component i have this error message : 

FATAL_ERROR System.LimitException: Too many query rows: 50001
Number of SOQL queries: 1 out of 100
number of query rows: 139180 out of 50000 *******

My query cannot be more filtered, my component use Chart.js to display Chart, so all the 139180 rows are needed.

Any suggestion ?
Trying to figure out how I would leverage a remoteaction/readonly scenario like I would in Visualforce but within lighting. The way lightning components communicate to Apex is similiar to the remoteaction functions as it calls a the apex function asyncrounsly. However I am doing a large aggregate query and I want to increase the 50 000 query rows touched limit. In Visualforce/Remoteaction you would declare your remoteaction function in apex with a @readonly annotation. However the system doesn't allow the @readonly annotation with the @Auraenabled annotation. I have tried declaring my functions with all three annotations (@auraenabled, @readonly, @remoteaction) but I am still hitting the 50 000 limit regardless which is telling me the @readonly functionailty isn't working. Does anyone have any adivce on how to make this possible?