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
ChickenOrBeefChickenOrBeef 

Task WhoID is NULL when created from BCC'd email

Hey everyone,

I have a task trigger that depends entirely upon the value in the WhoID field upon creation. I noticed that if a task is created via a BCC'd email, the trigger doesn't work. After putting in some debug statements, I saw that WhoID isn't populated upon creation when the task if from a BCC'd email.

Any idea what I should do?

Thanks,
Greg
Best Answer chosen by ChickenOrBeef
ChickenOrBeefChickenOrBeef
Hey Pavan,

I actually just figured this out. I gathered all the Task IDs in the trigger and then pushed them to a future class.

Do you think my method is cleaner than yours, or should I go with the Before Insert trigger?

Thanks!
-Greg

All Answers

Pavan DavePavan Dave
We can write before insert trigger on Task and can populate "To" value same as "BCC". 
ChickenOrBeefChickenOrBeef
Hey Pavan,

I actually just figured this out. I gathered all the Task IDs in the trigger and then pushed them to a future class.

Do you think my method is cleaner than yours, or should I go with the Before Insert trigger?

Thanks!
-Greg
This was selected as the best answer
Pavan DavePavan Dave
Not much idea about which future class you are referring to but if this solves your Null whoid problem then it's your call.
Thomas Graves 1Thomas Graves 1
Hey Pavan,

I'm running into this issue currently where the whoId is null. Can you expand on your comment about writing a trigger to set the whoId for the task?