You need to sign in to do that
Don't have an account?
AggregateResult issue
Hi all,
I seem to have hit a snag with my work. I have used this technique before but for some reason I am gettting this error, Method does not exist or incorrect signature: [List<AggregateResult>].get(String).
List<Contact> l_ConToUpdate = [SELECT ID,INV_YTD_Entertainment_Spend__c,INV_PYTD_Entertainment_Spend__c FROM Contact where Id in :Set_Id];
For (Contact con:l_ConToUpdate){
List<AggregateResult> l_EventToCountCY = [SELECT SUM(INV_Cost__c) Total FROM Event WHERE WhoId = :con.Id AND CALENDAR_YEAR(ENDDATETIME) = :System.Today().year() AND INV_Type__c = 'Entertainment'];
CY_Sum = Double.valueOf(l_EventToCountCY.get('Total')); <-- error on this line
Any hints?
Thanks!
Should be
since it is a list and you are not iterating it for a perticula value.
please use below code snippet, which will help you definitely :)
Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com