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
eduardofernandeseduardofernandes 

Sum meetings and activities

 
I wonder how I could get a sum of all the meetings that I realized in a particular opportunity.

Thanks to all who respond.



Cory CowgillCory Cowgill

If you are using standard Tasks and Events from Salesforce, the only way to create sums from Events (Meetings) is to do a Apex Trigger. Standard Tasks and Events in Salesforce are "Special" objects in the system. They are polymorphic objects, meaning they can be related to different objects with one field (ParentId). As such, they are not eligible for Roll-Up Summary Fields.

 

To accomplish you goal, you can create a trigger on the Events object. In the Trigger on an AfterInsert, AfterUpdate, AfterDelete, AfterUnDelete DML actions, you can perform AggregateSOQL calls to perform a Sum of the Meetings for the Opportunities, and then update the Opportunities.

 

 

Josephadm401Josephadm401

I am not sure if this will help but you may also use the reporting feature to find our how many tasks you have for a particular object. Just set the criteria to filter out for what you wish to see. ex) Type = Meeting