I am getting an error on line 20 invalid character in identifier: Inspection__Service__c.
public with sharing class AddedServicesGrouping {
public Inspection_Service__c[] Summaries {get; set;}
public AddedServicesGrouping(){
AggregateResult[] results =
[SELECT Added_Services_Group__c AddedService, count_distinct(id) Quantity
FROM Inspection_Service__c
WHERE Status__c = 'Completed'
GROUP BY Added_Services_Group__c];
Summaries = new List<Inspection_Service__c>();
for(AggregateResult ar: results){
Summaries.add(new Inspection_Service__c(ar));
}
}
public class Inspection_Service__c{
public Integer Quantity {get; private set;}
public String Name {get; private set;}
public Inspection_Service__c(AggregateResult ar){
Quantity = (Integer) ar.get('Quantity');
Name = (String) ar.get('Added_Services_Group__c');
}
}
}
And I also get the error: invalid field Quantity for SObject Inspection_Service__c for this visualforce page:
<apex:page controller="AddedServicesGrouping" readOnly="true">
<apex:form>
<apex:repeat value="{!Summaries}" var="s">
{!s.Name} : {!s.Quantity}<br/>
</apex:repeat>
</apex:form>