In Salesforce, maximizing efficiency and productivity is the name of the game. If you can't see or find your information exactly where you would like to, this limits company performance. If you have ever wondered what the best way for seeing the number of tasks on an open case is, or how to prevent cases from being closed if they still have open tasks, Rollup Helper has the perfect solution for you.
Count the number of open tasks by creating a rollup. Then, use the results within workflow rules, validation rules, etc... that will prevent the Case record from being closed if the count is higher than 0.
The first step is to create a new custom field (using Number as the data type) on the Case object. You can name the field "Number of Open Cases."
Create the rollup:
Select Case as the Destination Object
Select "Number of Open Cases" as the Target Field
Select Task as the Child Object
Use the default Relationship Field
Select Count as the Rollup Type. Note: IsDeleted is the default source field used for count rollups since it is a simple boolean field that exists on all records
Create a New Filter
Name the filter in step 1 (e.g. Open Tasks) then skip to step 3
In step 3 select the Status field
Select not equal to as the Operator
Select Completed for the Criteria
Save the filter and then Save and Run the rollup
You can now place a validation rule on “Case” using the “number of open tasks” field, which will prevent the record from being closed if the count is higher than 0. You now have a more productive, manageable Salesforce environment!