You need to sign in to do that
Don't have an account?
visual force email template Aggregate Results
Hi,
Im trying to create a visualforce email template that shows a parent object's sum of hours from child records. I have a parent and a child in a lookup relationship where the child has a field Hours__c number field. How do I get the sum of total hours and group by the parent records? I.E. show total hours by Task and then the grand total of hours for all tasks?
Thanks in advance!
Im trying to create a visualforce email template that shows a parent object's sum of hours from child records. I have a parent and a child in a lookup relationship where the child has a field Hours__c number field. How do I get the sum of total hours and group by the parent records? I.E. show total hours by Task and then the grand total of hours for all tasks?
Thanks in advance!
Create an Apex class that will get the aggregate result
and create a visualforce component page
call the component from the email template
Refer to this link
https://developer.salesforce.com/forums/?id=906F000000098RuIAI
https://salesforce.stackexchange.com/questions/33944/issue-in-displaying-related-object-fields-in-vf-email-template
https://salesforce.stackexchange.com/questions/172610/soql-query-to-get-the-email-template-id?rq=1
http://www.infallibletechie.com/2013/07/aggregateresult-in-salesforce.html
All Answers
Create an Apex class that will get the aggregate result
and create a visualforce component page
call the component from the email template
Refer to this link
https://developer.salesforce.com/forums/?id=906F000000098RuIAI
https://salesforce.stackexchange.com/questions/33944/issue-in-displaying-related-object-fields-in-vf-email-template
https://salesforce.stackexchange.com/questions/172610/soql-query-to-get-the-email-template-id?rq=1
http://www.infallibletechie.com/2013/07/aggregateresult-in-salesforce.html