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
muthu.swimuthu.swi 

Account name of WhoId in Task

Hi Guys
 
How do I get account name of WhoId from Task in a single query? Is this possible? I know Who.Name gives contact name of WhoId, What.name gives account name of WhatId. But, Who.Account.Name doesn't work as Who doesn't have reference to Account.
 
Thanks a lot in advance
 
*Muthu*
mtbclimbermtbclimber
You have to issue another query for this information. SOQL Relationships allow traversal to a very limited set of data (primarily just the object's name) with polymorphic reference fields like whatId and whoId on task/event.