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
ErrorProneErrorProne 

Aggravating AggregateResult

PHP API Call, 

 

I have a sum(Amout) in my Query which reutrns an "AggregateResult" 

 

how do I echo the AggregatedResult

kab1kab1

AggregateResult[] listData = [SELECT OwnerId, sum(Amount__c) amnt  From AmountData__c  GROUP BY OwnerId];

 

for (Sobject so : listData) {
AggregateResult ar = (AggregateResult) so;
Id OwnerId = (Id) ar.get('OwnerId');
Decimal tempAmount = (Decimal) ar.get('amnt');

}

 

 

Let me know if this resolves your issue