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
Stefan Senegeac D.Stefan Senegeac D. 

Get WhoId and WhatId Name from Event without queries

Just as the title says I want to get the name of ...let's say a Contact from Event by WhoId. I can get the WhoId then check if it's a Contact Id then query the Contact sobject and get what I want from there but that's not what I want. I want something along the lines of WhoId.Name or Who.Name (this doesn't give errors but doesn't work -> always returns null). Also the same for WhatId (What.Name if it's an Account for example).   

Is this possible or I'm restricted to querying?
AshlekhAshlekh
Hi,

As per my finding you have to use two query for this requirement as in query you can't recognize the Id type.

But need more analysis on this.

-Thanks
Ashlekh Gera