|

Polymorphic Relationships

In the Salesforce world, WhoId and WhatId are polymorphic relationships used for lookups.

When you see the fields “WhoId” and “WhatId” in a Salesforce object like a Task, these fields are polymorphic relationships – meaning they are a special type of lookup that can be related to one of many different objects.

Take the Task object – it has a field labeled “Related To” with the name “WhatId”. This establishes the connection between the task and the record you want to relate it to. This connection can be to any one of 119 objects – but you only get to choose one and they can’t be for people – see pic below.

polymorphic relationships



The Task object also has a Name field, a WhoId – meaning it can connect to a “person” like a Contact or a Lead.

WhatId -> connect to things, what thing are we connecting to?
WhoId -> connect to people, who are we connecting to?


Next time you are building an awesome automation and you come across a WhoId or a WhatId you will know what they mean.

Similar Posts