+ Start a Discussion
SharathKumar ReddySharathKumar Reddy 

How to get last updated Task related WhoID details using apex trigger? Can any please post the code its urgent?

AnudeepAnudeep (Salesforce Developers) 
Here is a sample code. Please change as per your requirement
trigger retrieveWhoId on Task (after insert, after update) {
List<String> wId = new List<String>();
for(Task t: trigger.new) {
	if(t.LastModifiedDate = TODAY) {
	System.debug('whoId is' + t.whoId);

If you find this helpful, please mark this answer as Best. It may help others in the community. Thank You!