-
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 Summer '25 Highlights
Summer is nearly here, and Salesforce's Summer '25 release update means there's more to look forward to than the sun and the beach. Whether you've…
An Ultimate Guide on How to Import Data in Salesforce
Data is an integral part of an everyday business and the effectiveness of its management determines whether the business will be a success or not.…
Why CRM is Important for Every Business | Salesforce
Customers are the most important asset to any business no matter what industry you belong to, what your focus is or what kind of products…
Popular Salesforce Videos
Set Your Sales Cloud Implementation Up for Success
Make Sales Cloud a valued business tool that your sales reps will rely on by starting with these planning strategies and best practices for success.…
Salesforce App Builder Training | Salesforce App Builder Tutorial | Intellipaat
In this salesforce app builder tutorial, you will learn what is Salesforce CRM, a Sales rep in Salesforce, various user settings in Salesforce, and how…
Introduction to Salesforce and Data Modeling | Quick Start | Episode 1
In this video, you will get started with Salesforce Development and build Salesforce Applications without writing code. Watch this video and learn. 00:00:00 - Start…