function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GaneeeshGaneeesh 

how can i display rating value from Aggregate result..?

here i can easily display Annual revenue and i can't display rating value from AggregateResult..my code

 

if i use this code i can easily display Annualrecenue sum

list<AggregateResult> lst=[Select Rating, sum(Annualrevenue) sales from Account group by Rating ];
System.debug('*****************'+lst);
for(Aggregateresult ar:lst){
System.debug('*****************'+ar.sales);
}

 But if i use this code i can't display rating value how can i display rating value...?

 

list<AggregateResult> lst=[Select Rating, sum(Annualrevenue) sales from Account group by Rating ];
System.debug('*****************'+lst);
for(Aggregateresult ar:lst){
System.debug('*****************'+ar.rating);
}

 

how can i display rating using this can anybody help me.........................................................................?

 

SKiranSKiran
Hi, AggregateResult is little bit different than sobjects, you will have to use ar.get('Rating'). Accept this as answer if this helps thatnks!!!
GaneeeshGaneeesh

no its getting error..