You need to sign in to do that
Don't have an account?
Ali Abdullatif
Showing an Aggregated query in Visual force table doesn't work PLEASE HELP
I have this class that only does this query
and I want to show it in this page
but the file doesn't save as it tells me
Save error: Invalid field Domestic_Helper__r for SObject AggregateResult ContractsStatisticsPage.page
public with sharing class Contracts_Statistics_Page_Controller { public List<AggregateResult > allFTContacts { get; set; } public Contracts_Statistics_Page_Controller (){ allFTContacts = [select count(id), Domestic_Helper__r.Current_Status111__c, Full_Time_Client__r.Status__c, Cancelled_contract__c from Contract_Full_Time__c where End_of_Contract__c>YESTERDAY group by Domestic_Helper__r.Current_Status111__c, Full_Time_Client__r.Status__c, Cancelled_contract__c]; } }
and I want to show it in this page
<apex:page controller="Contracts_Statistics_Page_Controller" showHeader="false"> <apex:define name="body"> <apex:form id="mainForm"> <apex:pageBlock id="myPageBlock" title="Contracts Statistics"> <apex:pageBlockTable id="myPageBlockTable" value="{!allFTContacts}" var="item" styleClass="maintable"> <apex:column headerValue="Domestic Helper status" value="{!item.Domestic_Helper__r.Current_Status111__c}" /> <apex:column headerValue="Full Time Client status" value="{!item.Full_Time_Client__r.Status__c}" /> <apex:column headerValue="Cancelled Contract" value="{!item.Cancelled_contract__c}" /> <apex:column headerValue="Count" value="{!item.count(id)}" /> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:define> </apex:page>
but the file doesn't save as it tells me
Save error: Invalid field Domestic_Helper__r for SObject AggregateResult ContractsStatisticsPage.page
So - I think you'll have to do a column like this (but I'm not sure).
<apex:column value="{!item.get('Domestic_Helper__r.Current_Status111__c')}" />