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

What is whoId & whatId? and those usage

these are related objects IDs on the Activity record.
WhatId could be used to link that activity with Account,Oppty,Custom object etc

WhoId can be used to link the activity with Contact, Lead etc

Kittu9, these are what we call polymorphic keys. They are called polymorphic because they can point to different objects. Perhaps the two most common types are tasks and events but there are other such polymorphic keys like some owner fields that can either point to a User or Group. The whatId and what field points to something, like and account, or opportunity. The whoId and who field point to someone like a contact or a lead. You can query via both of these fields. You can also now do some really cool SOQL with polymorphic SOQL. Check this link out. It explains it very well.


WHOID and WHATID are polymorphic keys. Polymorphic key is a relationship field which can relate to more than one type of object as parent. Unlike Lookup and Master-detail relationships which are related to a single object, Polymorphic keys can refer to multiple objects.


For more details please refer:-