+ Start a Discussion
jacoclockedjacoclocked 

Rollup Summary to Sum a field on related object

Looking for the best/easiest way to perform the below whether it be trigger or using a junction object and leverage workflows. 

 

Object 1: Project

Object 2: Milestone

 

Relationship exists only through lookup field.  Creating a master detail is not possible between these two objects.   A given project can have many milestones.  

 

Each milestone has a field called 'Current Planned Hours' which is a numerical text field that requires manual entry.  I'd like to display 'Total Current Planned Hours' on the project record.  Whenever an update is made to the 'Current Planned Hours' on any milestone this amount is reflected on the 'Total Current Planned Hours' on the project form.  The 'Total Current Planned Hours' is the sum of all the milestone's 'Current Planned Hours'. What's the best way to accomplish this? 

 

Project - XYZ

Total Current Planned Hours =  40

 

Milestone 1 for Project XYZ

Current Planned Hours = 20

 

Milestone 2 for Project XYZ

Current Planned Hours = 20

 

Thanks!!!

ForceComForceCom

Hi, 

 

Here is nice blog post about rollup summary on look up. 

 

http://www.anthonyvictorio.com/salesforce/roll-up-summary-trigger/

 

thanks,

Dharani

 

jacoclockedjacoclocked
Thank you sir. I will check it out and try to apply the solution to my
situation.