Where will we use whoId and whatId basically in salesforce?

Very confusable can anyone help me out

  • Have you googled it? There are number of examples and articles related to this topic. At SFSE we encourage users to search and try to solve their problems on their own before asking the question. :)
    – Mahmood
    Nov 20 '17 at 12:44
  • 1
    Salesforce also has good description on both here.
    – Mahmood
    Nov 20 '17 at 12:46

"WhoID" refers to people things. So that would be typically a Lead ID or a Contact ID

"WhatID" refers to object type things.That would typically be an Account ID or an Opportunity ID

You can use query something like this :

                select id, whatid from task

plaese see the snap.

whoid is lookup field of contact object and whatid is lookup field of account object on task object

enter image description here

Regards, Suraj

  • 2
    That is not completely right! WhoId can also belong to a Lead; WhatId can be opportunities, campaigns, cases, or custom objects not just accounts.
    – Mahmood
    Nov 20 '17 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.