
WhoId and WhatId in Salesforce

Table of contents
- WhoId in Salesforce
- WhatId in Salesforce
- Overview of Salesforce Data Architecture
- Common Use Cases of WhoId
- Common Use Cases of WhatId
- Difference Between WhoId and WhatId in Salesforce
WhoId in Salesforce
The WhoId
field in Salesforce is used to associate an activity (such as a task or event) with a contact or lead. It is a polymorphic field, meaning it can reference different types of objects. Specifically, WhoId
can point to records from the Contact
or Lead
objects.
Example of WhoId
Imagine you have a task to follow up with a potential customer who is a lead in your Salesforce system. You create a task and set the WhoId
to reference the Lead record.
{
"Subject": "Follow-up Call",
"WhoId": "00Q1I000001d3V1UAI", // Lead record ID
"Status": "Not Started"
}
In this example, the task is linked to a lead through the WhoId
, which enables Salesforce users to see the task in the context of the lead’s record.
Enroll in our 100% Job placement assistance Salesforce online course program today and take advantage of our free demo to learn more. Our Salesforce course integrates Trailhead to ensure comprehensive learning.
WhatId in Salesforce
The WhatId
field in Salesforce is used to associate an activity (such as a task or event) with any object other than a person. This includes standard objects like Account
, Opportunity
, Case
, Campaign
, and custom objects.
Example of WhatId
Consider you have an event scheduled to discuss an opportunity with a client. You create an event and set the WhatId
to reference the Opportunity record.
{
"Subject": "Opportunity Discussion",
"WhatId": "0061I0000048V1rQAE", // Opportunity record ID
"StartDateTime": "2024-07-15T10:00:00.000Z",
"EndDateTime": "2024-07-15T11:00:00.000Z"
}
In this example, the event is linked to an opportunity through the WhatId
, allowing Salesforce users to track the event in relation to the specific opportunity.
Overview of Salesforce Data Architecture
Objects, Records, and Fields
In Salesforce, the data architecture is built around objects, records, and fields. These are the fundamental elements that define how data is stored and managed within the platform.
- Objects: Objects are tables in the Salesforce database that store a particular type of information. There are standard objects (like Account, Contact, Opportunity) and custom objects created to fit specific business needs.
- Records: Records are individual instances of an object. For example, if the object is Contact, then each contact person is a record within that object.
- Fields: Fields are columns in the object table. They store individual pieces of data within a record. For example, fields in the Contact object might include First Name, Last Name, Email, and Phone Number.
Relationships
Relationships in Salesforce define how objects are related to each other. There are different types of relationships:
- Lookup Relationships: This is a loosely coupled relationship between two objects. It allows one object to contain a reference to another, creating a parent-child relationship without dependency.
- Master-Detail Relationships: This is a tightly coupled relationship where the child object’s existence is dependent on the parent object. Deleting the parent record also deletes all related child records.
- Many-to-Many Relationships: This is achieved using a junction object, which contains two master-detail relationships to connect two objects.
Common Use Cases of WhoId
The WhoId
field in Salesforce is used to associate activities with people-related records, specifically leads and contacts. Here are some common use cases:
- Task Management: Assigning follow-up tasks to leads or contacts to ensure timely communication.
- Event Scheduling: Linking events such as meetings or calls to a specific contact or lead to track interactions.
- Sales Activities: Logging sales calls or emails related to potential customers to maintain a history of communication.
- Customer Support: Associating support tasks or follow-up actions with contacts to provide personalized support experiences.
- Marketing Campaigns: Tracking interactions with leads generated from marketing campaigns to measure effectiveness and engagement.
Common Use Cases of WhatId
The WhatId
field in Salesforce is used to associate activities with non-person objects. Here are some common use cases:
- Opportunity Tracking: Linking tasks or events to opportunities to ensure proper follow-up and tracking of the sales process.
- Case Management: Associating support tasks with cases to track resolution efforts and customer service activities.
- Account Management: Attaching activities to accounts to keep a record of all interactions and activities related to a particular client.
- Project Management: Linking tasks to custom project objects to manage project timelines and deliverables.
- Campaign Tracking: Associating activities with marketing campaigns to track engagement and follow-up actions.
Difference Between WhoId and WhatId in Salesforce
Feature | WhoId | WhatId |
---|---|---|
Definition | Associates an activity with a lead or contact | Associates an activity with any other object (e.g., Account, Opportunity) |
Object Types | Lead, Contact | Account, Opportunity, Case, Custom Objects, etc. |
Use Cases | Personal follow-ups, sales calls, meetings, customer support | Opportunity tracking, case management, account management, project management |
Example | Task to follow up with a lead | Event related to an opportunity |
Summary
Understanding the differences between WhoId
and WhatId
and their use cases is crucial for managing activities in Salesforce. The WhoId
field links activities to people-related records, while the WhatId
field links activities to non-person objects. This distinction helps in organizing and tracking various interactions and activities efficiently within the Salesforce ecosystem.
For those looking for Salesforce learning, CRS Info Solutions provides an extensive Salesforce training program designed to enhance your skills and career opportunities. Explore our Salesforce training in Hyderabad to gain practical, hands-on experience. Our training covers all essential aspects of Salesforce, ensuring comprehensive learning.