This is my first post in the Power of Point & Click Series through which I will demonstrate various use cases wherein people usually jump into apex customization to achieve it, but can however be easily configured using the declarative capability of the Force.com platform. So, in this post I will talk about roll-up summaries which if used a bit differently can be leveraged in a much better way. I decided to write on this after I came across this requirement by one of the Customers in the Salesforce success community below.
Use Case : ABC uses Cases and a custom object named as “Parts” as a child object to Cases in a master-detail relationship. They have a Status field in the Part object which can have either “Pending” or “Received” values. They have a business scenario wherein, when all the parts associated to a Case is set with the status value of “Received”, a workflow should fire and create a task.
Well, this is something that one can easily achieve using apex customization. What about doing it through point-and-click ? Very much achievable !
Implementation : The approach to this case is pretty simple. We just have to create 2 roll-up summary fields on the Case object. The first roll-summary field which will be named as “Total Count” will just count the total number of parts associated against a case irrespective of it’s status value.
Calculation of Total Count
The second roll-up summary field which will be named as “Received Count” will count the total number of parts associated to a Case with only the “Received” status. You just have to apply a filter on your roll-up like below to achieve this.
Calculation of Received Count
The next step is to create a workflow rule on the Case object which will just check that the value of Total Count is equal to the Received Count. This will ensure that the rule is fired when all the parts associated to a Case is set to “Received” status and create the appropriate task required.
Now we can go ahead and create the required task or any workflow actions over this rule and use it.
That’s it. Just active your workflow and you are good to go !
Happy using roll-up summaries !