-
WhoID is null when send email in sandbox on Contacts
I have created a trigger on task (before Insert) and just displaying the trigger.new value ,i.e, the task which is created . In the debug it is showing me that whoid is null , I am sending the email from "Send An Email" button on the activity history of contacts .
Here is the code for the trigger :-
trigger triggerOnTask on Task (before insert) {
if(trigger.isBefore && trigger.isInsert){
for(task ts : trigger.new){
System.debug('>>>>>>ts'+ts);
System.debug('>>>>>>'+ts.Description);
System.debug('>>>>>>'+ts.whoId);
Id myId=ts.whoId;
}
}
}In the above code, whoId is null in debug when I click on send Email button.
Any suggestions why is the WhoId null in the task created.
Also , this is working in my dev org and I am getting the whoid value but in sandbox it is working on leads but not working on the Contacts.
Log In to reply.
Popular Salesforce Blogs
Pardot VS. Marketing Cloud: Differences and FAQs [INFOGRAPHICS]
Should I choose Pardot (Marketing Cloud Account Engagement) or Salesforce Marketing Cloud to automate marketing campaigns in Salesforce? Is there any difference? Is Pardot a…
Apex Intention Actions: The Next Frontier for Apex Completions
Idea from IDEa Recently, I needed to code a little tool in Java. The last time I coded something in Java was in high school,…
What are Salesforce Big Objects? | The Developer Guide
We are all aware that Salesforce objects are used to manage and tinker with our data. Standard objects, custom objects, and external objects are likely…
Popular Salesforce Videos
Use Case Hierarchy to Link Cases in Salesforce
Want to link your cases, so you and your team have a complete view of what’s going on with a customer? Do you want to…
Accelerate Revenue by Simplifying Partner Data Exchange
Adeptia Webinar :: Self-service approach to set up secured B2B data exchanges. Allowing IT to focus on governance for ensuring compliance, security, and control.Reducing IT…
Modern App Development On Salesforce - Apex Testing
In this series, you will explore Modern App Development on the Salesforce platform, including Heroku. The live hands-on sessions will take you through the journey…