+ Start a Discussion
Nicole RocheNicole Roche 

Custom Field for Open Activities

I am trying to create a custom field to map my to with marketing automation tool to that will tell my if there is an open event on an account. So specifically an event, not an open task. Essentially I want to build a list off of this to exclude those contacts at these accounts from receiving automated emails. This is an indicator that my sales team has a scheduled conversation with them. Has anyone done this before?

Hi Nicole,

There is no standard solution for this. I have worked on many of this functionality/logic. Here are the high level steps,

- Create a nightly scheduled job which will fetch a list of tasks and events LAST MODIFIED in the last twenty four hours
- Gather the set of Account IDs in a set by iterating over the task list obtained in step 1
- For those accounts, query for all the open tasks. If open task found, then mark the flag on account otherwise uncheck the flag
- For data consistency, run the same for all accounts once in a month
- Your code should also handle tasks deleted (so use ALL ROWS in soql)
- Determine to use Task object in your soql or Task Relation

Bharathimohan Ramaurthy
Salesforce For All (http://salesforceforall.blogspot.com/)