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
jill.longojill.longo 

VF page to aggregate Account, Contact and Custom Object data into a single view

Has anyone created a VF page that aggregates Account data into a single view that would allow the Account Owner to generate a report/PDF? We have found that using a report doesn't provide a valuable view of an account, especially when we are pulling data from multiple objects. Ideally the user would click a button on the Account that says generate Account Overview.  I'm looking for code that would give me an idea of how to start this and then add in our custom objects.
Sonam_SFDCSonam_SFDC
There are ways you can frame your SOQL query to get the required aggregate result for the Account records you have - it depends on your requirement actually.

Following are some posts/blog where the user has used aggregate functions to pull data from DB based on his requirement:
https://developer.salesforce.com/forums?id=906F00000009629IAA
http://salesforcetrekbin.blogspot.sg/2010/04/group-by-clause-in-salesforce-soql.html
http://www.infallibletechie.com/2013/07/aggregateresult-in-salesforce.html 
Cloud_forceCloud_force
If you want a button on account record then develop a visauflorce page with account standard cotroller you can associate a class with that vf page as an extension [to do all your calculation]
here s a simple example for this:http://www.cloudforce4u.com/2013/07/pass-value-from-visualforce-page-to.html

t
hanks,
http://www.forcexplore.com/2014/01/salesforce-interview-questions-2.html
Ramu_SFDCRamu_SFDC
see if the solution provided here suits your requriement

https://developer.salesforce.com/forums/?id=906F00000009XMUIA2