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
Supriya P 24Supriya P 24 

How to count no.of contacts associated to the Log a call Activity?

Hi All,

I wanted to know how can we count number of attendees (contacts) are added when Log a call Activity is added. 
The number of attendees should be displayed in opportunity.

ANy thoughts on this implementation will be highly appreciated.
Thank you in Advance.
Supriya
VinayVinay (Salesforce Developers) 
You can try below 2 options that might be closest possible recommended solution.

>> Write scheduled apex to daily go through contacts and count the number of tasks within the X months restriction, and write that to a field on the contact record.

>> Write a trigger on Tasks to create a copy of the activity which does have a master-detail relationship with the contact.  The advantage of this is that it is much more flexible - once the trigger has been setup, the roll up summary can be changed by admin (change the filter criteria as the business require).

Reference:
https://trailblazers.salesforce.com/answers?id=90630000000gxXmAAI

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Supriya P 24Supriya P 24
Thank You @ Vinay

I want to calcuate number of conatcts each activity has.
I tried with flow and it worked. 

Thanks,
Supriya