-
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

Salesforce Einstein Vision: How it works?
Before starting about this, Please give few minutes to this article What is AI and Machine Learning? If you have done with above blog. Let’s cover Salesforce…

Effortless Integration of Salesforce Org Documentation Into Atlassian Confluence
Are you tired of the manual and time-consuming process of documenting your Salesforce organization? Look no further than AbstraLinx, a revolutionary tool designed to streamline…

Bypassing the “Number of Iterations Exceeded” Error in Salesforce Flows with Platform Events
Elements Limit in Flows Flows in Salesforce are great, but there are some limits that can make working with them very frustrating. One of those…
Popular Salesforce Videos
How Salesforce AppExchange Can Boost Your Application's Marketing ?
Explore the key benefits of AppExchange, the largest business app marketplace, and discover how you can tap into its vast ecosystem of potential customers. In…
How to Get a Job in Salesforce as a Fresher | Video Guide
Looking to start a career in Salesforce. Wondering how to get a job in Salesforce as a fresher. Check out this video it will guide…
What are Roll-up Summary Fields in Salesforce? | How to create them?
In this video, Shrey is not only teaching but also demonstrating to you "What are Roll-up Summary Fields in Salesforce?". You will be learning: 1.…