In Salesforce, understanding the distinction between WhoId and WhatId is crucial when working with tasks and events. These fields, labeled as “Name” and “Related To” in the user interface, help associate activities with the correct records, enhancing data accuracy and reporting capabilities.

Understanding Activities in Salesforce

Activities, such as tasks and events, are actions recorded in Salesforce to track interactions like calls, meetings, and emails with customers or prospects. Properly associating these activities with relevant records ensures a comprehensive view of customer engagement.

WhoId (Name Field)

The WhoId field, known as “Name” in the interface, links an activity to a person. Specifically, it references records from the Lead or Contact objects.

  • Lead: An individual who has shown interest but is not yet qualified.
  • Contact: A person associated with an existing Account.

When you schedule a meeting or make a call to a lead or contact, you use the WhoId field to associate the activity with that person. This connection allows for detailed tracking of interactions with specific individuals.

Example

If you’re planning a meeting with John Doe, a contact at a client company:

  • WhoId: Select John Doe from the Contact records.

WhatId (Related To Field)

The WhatId field, labeled as “Related To,” associates an activity with an object other than a person. It can reference records from various standard and custom objects, such as:

  • Account
  • Opportunity
  • Case
  • Campaign
  • Custom Objects

Using the WhatId field links the activity to a specific business record, providing context about the purpose or subject of the interaction.

Example

Continuing the previous scenario, if the meeting with John Doe is about a potential deal:

  • WhatId: Select the relevant Opportunity record.

Key Differences Between WhoId and WhatId

While both fields associate activities with records, they serve different purposes:

  • WhoId: Refers exclusively to Lead or Contact records (people).
  • WhatId: Refers to objects like Accounts, Opportunities, Cases, and Custom Objects (non-person entities).

Understanding this difference ensures accurate data linkage and effective activity tracking.

Special Considerations

  • Polymorphic Fields: Both WhoId and WhatId are polymorphic, meaning they can reference multiple object types.
  • Shared Activities: If enabled, you can associate up to 50 contacts (not leads) with a single non-recurring activity.
  • Lead Limitations: When the WhoId is a Lead, the WhatId (Related To) field is not available because Leads are not yet associated with Accounts.

Account Association Logic

Salesforce automatically attempts to associate an activity with an Account based on the WhoId and WhatId fields:

  • If WhoId is a Contact, the activity associates with the Contact’s Account.
  • If WhatId is an Account, the activity associates directly with that Account.
  • If WhatId references an object related to an Account (like an Opportunity), Salesforce links the activity to the associated Account.

However, if the WhoId is a Lead, the Account field remains empty since Leads are not connected to Accounts until they are converted.

Best Practices

  • Accurate Associations: Always populate the WhoId and WhatId fields appropriately to maintain data integrity.
  • User Training: Ensure users understand the purpose of each field to avoid misclassification.
  • Regular Audits: Periodically review activities to confirm they are linked to the correct records.

Conclusion

Grasping the difference between WhoId and WhatId enhances your ability to track and report on activities within Salesforce accurately. By properly associating tasks and events with the correct people and records, you improve data quality and gain deeper insights into customer interactions.