0

So far, I have attempted to build several processes to achieve this using the Process Builder. None of the processes are completing, or firing for all I know, because I don't get an error message if/when it fails. I tried creating workflow rules to help this process along, but to no avail. I don't know enough about Apex to write the code myself, and have been though about two dozen different tutorials and forums trying to scour the internet for a viable answer.

This is what needs to happen: When I send out a Mass Email, a task is automatically created on the person account(contact). This task is given a date, and it is THIS date that I'm trying to auto-populate on the contact page in a custom field labeled "Last Mass Email Sent" (date field).

I would appreciate any help. Thank you.

EDITED FOR MORE INFORMATION

Here is the Process I have built:

START >

Object: TASK ('When a record is created or changed'is checked) >

Criteria: (Conditions are met) [Task].Subject ... 'Starts With' ... ' ... 'String' ... 'Mass Email' (All mass emails start with "Mass Email", making it easy to distinguish.) >

Immediate Actions: Update A Record .. Record: [Task].Name ID (Contact) .. {{From here I have used [formula Today()] [Field Reference: [Task].ActivityDate]}}

I am using the Mass Email Contacts from the Contact tab. I noticed that when the system creates a Task for the mass email, the process builder doesn't recognize it as a created event. When I go in and manually update the Task, the contact gets updated by the Process I built. Something is or isn't happening correctly.

  • Welcome to SFSE! I don't have the answer to your question, but can provide advice that may lead to someone else being able to help you. I haven't worked with the person accounts feature, but I have heard that it makes some things behave...differently. If you share the Process Builder processes and workflow rules (and their actions) that you've tried to build, it may help people point you in the right direction. Also, how are you sending out your mass email? Depending on what you're using, you may not be able to hook into the process (to generate your tasks) at all. – Derek F Oct 10 '18 at 19:20
  • (continued) Are you expecting to be able to handle creating tasks for more than one contact? or do you only create one task no matter how many people are involved in an email? You can add this additional information to your question by making an edit – Derek F Oct 10 '18 at 19:22
  • I made a change to my earlier post. The tasks are being generated perfectly. It's the following process that I'm trying to automate that's giving me an issue. I want the date when the email was last sent to that contact to populate on a custom field that I have created on the contact layout. – Zachariah Diaz Oct 10 '18 at 20:18
1

"Mass email actions" are documented as an operation that does not fire triggers.

That's not very specific, but your experience suggests this is one of those actions, as you say

when the system creates a Task for the mass email, the process builder doesn't recognize it as a created event. When I ... manually update the Task, the contact gets updated by the Process

Operations that don't support triggers generally also do not support workflow rules or Process Builder.

One approach to address this would be to use the popular, open source Declarative Lookup Rollup Summaries package. You could build a DLRS rollup in Scheduled mode, with the parameters

Parent Object: Contact
Child Object: Task
Relationship Field: WhoId
Relationship Criteria: Subject LIKE 'Mass Email%'
Relationship Criteria Fields: Subject
Field to Aggregate: ActivityDate
Field to Order By: ActivityDate
Aggregate Operation: Last
Aggregate Result Field: <your target field>

Configure it to run in Scheduled mode every night, and it'll refresh your latest dates on a regular basis. This is a common pattern for doing rollups around non-triggerable activities.

  • Thank you for your reply. I don't have this package installed yet, so I'm going to attempt this in my sandbox tomorrow morning and I'll post the results here. – Zachariah Diaz Oct 10 '18 at 20:55
  • 1
    Thank you so much for recommending the DLRS to me! I built the rollup according to your parameters and it worked perfectly! I'll be installing in PROD today and implementing the rollup you helped me create! Again, thank you so much. I'm so happy I didn't have to resort to Apex triggers for this. – Zachariah Diaz Oct 11 '18 at 14:23
  • I'm so glad that helped! DLRS is an incredibly powerful tool - since you have it now, keep it in mind any time you need some kind of summary information that goes beyond what a native Roll-Up Summary Field can do. – David Reed Oct 11 '18 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.