I have a class that is correctly pulling an AggregateResult in from a child object on a custom object. I'd like to use an pex:pageBlockTable to display the aggregateResults but when trying to setup the header I get an error.
This works per system debug checks:
public List<AggregateResult> getAggregateList(){
Parent_Custom_object__c TheCS = (Parent_Custom_object__c)sc.getRecord();
List<AggregateResult> AggResults = new List <AggregateResult>();
AggregateResult[] aggQuery = [select
zone__c zone,
SUM(Added_Value__c)TotalAddedValue,
SUM(delivered_units__c)TotalDelivered
from Custom_Child_object__c
where Parent_of_Custom_Child_object__c =:TheCS.id
GROUP BY zone__c
];
if(aggQuery!=null){
for(AggregateResult QAR:aggQuery)
{
AggResults.add(QAR);
}
Visualforce page:
<apex:pageBlock title="AggregateList">
<apex:pageBlockTable value="{!AggregateList}" var="d" id="Zone" title="Aggregate">
<apex:column value="{!d.Zone}" headervalue="Zone" ></apex:column>
</apex:pageBlockTable>
Error: Error: Invalid field Zone for SObject AggregateResult