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
Baylor PeakBaylor Peak 

Outbound Email Message Activity?

Helo all,

I have a Trigger that does a rollup of different Touchpoints on a Task. One of these Touchpoints is "Email".

What's happening is on an Insert/Update/Delete, the filed is recalculated with teh total numbert of Email Activities, except for those that came from an Outbound source via Email to Salesforce.

User-added image
So these Outbound emails are generated an an Activity and I want to be able to include the count of these Outbound Email Messages in my Total Email Touchpoints rollup.

Is this possible, becasue I am havinmg trouble trying to figure out what Object associated with External emails sent to Saleforce so I can just quertry on that object to get my number?

Regards,
Baylor
Baylor PeakBaylor Peak

My apologies, let me clarify.

OK, so I have a custom field on the Contacts object called Total_Email_Touchpoints__ which is a rollup summary for Tasks(Activities) with the Type called "Email" from a picklist.
So the Trigger on an Insert, Update will sum the total of all the Type of "Email" and then populate the Total_Email_Touchpoints__ field on the Contact page.


Here is the issue, there are Outbound Emails coming into Salesforce that generate an Activity. So on the Activity History, you will see all these outbound emails. The Total_Email_Touchpoints__ only updates from the Task object with the Type, "Email".
I want to know is there a way to capture the number of Outbound Emails that are generated as an Activity and then add that to my Trigger so I get the total of all Email Activities from botyh the chosen Type and those coming in as an Outbound Email Message?