• Fabrice Challier 12
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
hello everyone, 

can someone please help me to fix the following issue lighting web component, 

1) i am using soql query to get the records from the salesforce wiring in javascript. 
    here i have one field --> selection__c,
    now my requirement is if the selection is true then i have to table row in green if its false need to show color in red;
    now my code is like below
    
    
<table>
        <th>
          <td> name <td>
          <td> name <td>
          <td> name <td>
          <td> name <td>
        <th>
        <templete if:true ={selection">
            
              <tr style="background:lightpink;> 
            <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>              </tr>
                  
            <tr>
            </templete>
            <templete if:false ={selection">
            
              <tr style="background:green;>  
              <td></td>
              <td></td>
              <td></td>
              <td></td>
              <td></td>
                  
            <tr>
            </templete>


    now my requirement is, I don't want to use the same code under the template for false and true conditions, 
    i will have to select the color based on the true or false condition. 
    
    can someone please suggest me how to achieve it in lighting web component 
your help is appreciated, thanks for your help advance. 
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 ?