function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

SOQL difference event between whoID and OwnerID


I would like to understand the difference for an event object between whoID field and OwnerID field?

OwnerID is the assigned to field, what is the whoID field

Thanks for your help


OwnerId is the id of the uesr record who ownes this event. Eg. the person who is assigned to this Event. However the WhoId is the id of the Lead or Contact record On which this Event is created. Eg. I have a contact John and go to John's contact record to create an event then that event will have my Id(user record id) as the owner Id and John's Contact record Id as the whoId.


This will explan you about each and every field on Event Object


[Do mark this answer as solution if it works for you and give a kudos.]

whoID is the Name field you see in the event page UI.
Tejpal KumawatTejpal Kumawat



there are basic difference between whoID field and OwnerID field on EVENT object  is:


1. WhoId : ID of a related Contact or Lead. If the WhoId refers to a lead, then the WhatId field must be empty. Label is Contact/Lead ID. If Shared Activities is enabled, this is the ID of a related Lead or primary Contact.


2. OwnerId : ID of the user who owns the event. Label is Assigned to ID.    



When You click In the Calendar section of the Home page, click New Event. And add Name : Contact or Lead, those Id is Whoid. And add Assigned To : User, that id is Owner Id.


You can see it aslo by creating new Event and test query in developer console.


Event event = [SELECT WhoId, WhatId, OwnerId, Subject, StartDateTime FROM Event LIMIT 1];



If any confusion please let me know?