• Krishna Subramanyam
  • NEWBIE
  • 5 Points
  • Member since 2014
  • KMIT


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello Salesforce !
I need your help for displaying an aggregate result from soql query on my visualforce page
Here is apart of my controller :
public List<AggregateResult> somme {get; set;}
public Integer total {get; set;}

public Controller2(){
somme = [select SUM(Montant_total_calcule__c)total from Commande__c where Id IN :sCommandeId];

for(AggregateResult ar : somme){
total = (Integer) ar.get('total');
}

}

And for the page :
<apex:form>
<apex:pageBlockTable value="{!somme}" var="s">
<apex:column>Montant total : </apex:column>
<apex:column value="{!s.total}"></apex:column>
</apex:pageBlockTable>
</apex:form>
When i try to save my visualforce page, it gives me an error :  Invalid field total for SObject AggregateResult
I'm a beginer in salesforce and I don't know how to fix that error and display the result of my query in my page...

Thank you :)
  • July 24, 2015
  • Like
  • 0
Getting this Error Dont understand what to do.

This is the challenge in Visualizing Your Data in the module of Report and Dashboards.
"
One or more of the following is incomplete in the Dashboard: no component uses the 'Cases by Status' report as a source report, your component does not have a 'Cases by Status' header, and/or your component does not have a 'New vs Closed' title.
"

I done all this thing correctly and also check many time but not finding solution.
User-added image+
User-added image
User-added image


Hope that this screen shot will help you to understan my problem.

Thanks in advance.