-
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
What Are Setup and Non-Setup Objects in Salesforce
In this top salesforce blog, we will be discussing what are Setup and Non Setup Objects in Salesforce. Setup and Non-Setup Objects in Salesforce Non-Setup…
How DemandBlue’s Salesforce Revenue Cloud Implementation Helped its Customers to Enhance Sales Pipeline, Quote-to-cash, and ROI
The B2B buying segment has become more dependent on fast and flexible purchasing options rather than the usual buying process. This applied change is evident…
Triggers in Salesforce - All You Need to Know
Trigger A trigger is a piece of code that runs before and after a record in the force.com database is inserted, updated, or deleted. Triggers…
Popular Salesforce Videos
What is Salesforce | Salesforce Training Videos For Beginners | Salesforce Tutorial
This Salesforce Training Video will help you an introduction to Salesforce Administrator and Platform App Builder Certification Training course offered by Simplilearn. By end of…
Different tools use to code in APEX | APEX Basics | Salesforce Development Course
Are you aware of the tools that are used for writing codes in APEX? Here are the different tools that you can use to write…
Salesforce Career Personality Quiz
Which Salesforce career path is right for you? Take this 23 question quiz to learn which Salesforce career is the best match for your personality…