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
ElJefeElJefe 

SUM data in a pageBlock table?

How can I SUM data returned in a pageBlock, or do I need to use another method to do so?  I am trying to create a Billing Report, returning Project data and N line items for Time & Expense, and I need to summarize the Time and Expense sections, then add those subtotals together.  

Any approach advice is appreciated as I am brand new to VisualForce.

MohitMMohitM

Instead of page block you use the inner class in which each row will act as the object.Put this object in the loop and save  its value in list or Map.

 

Mohit Mohan

  Salesforce Developer Support

 

ElJefeElJefe

So you are telling me I need to create a custom class, and that there is no way in simple visualforce to SUM records?

ElJefeElJefe

Is there any way I can create a formula field that does: SUM(Projects__c.Time_Sheets__r.Total_Line_Amount__c)  ?