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
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.