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
SpunkySpunky 

Phone and Email field in Events

Is there an issue with the phone and email fields in the event object?

 

They're supposedly standard Event Fields but I can't query or reference them.

 

Help!

Best Answer chosen by Admin (Salesforce Developers) 
*werewolf**werewolf*
No that won't work. WhoId is polymorphic, that is it can point to more than one object, so you can't use it directly as a reference. You have to query the lead or contact it points to first and the get the phone and email fields from that. And you won't be able to do that in a formula field, you van only do it with an Apex trigger.

All Answers

*werewolf**werewolf*

Those fields are actually derived from whatever's in the WhoId.  I'm not sure why they're not queryable, but you can get the same info by querying on the Lead or Contact in WhoId and getting its phone and email fields.

SpunkySpunky

I did try stringing using the WhoId but it's not working.

 

For example, I have this formula field on the activity custom fields to string the account name

HYPERLINK("/"& Account.Id, Account.Name)

 

Since the WhoId is a lookup just like the WhatId, I figured this would work but it doesn't save

HYPERLINK("/"& WhoId, WhoId.Phone)

 

The error message I'm getting for "Phone"and Email is "not a field on the Event object"

*werewolf**werewolf*
No that won't work. WhoId is polymorphic, that is it can point to more than one object, so you can't use it directly as a reference. You have to query the lead or contact it points to first and the get the phone and email fields from that. And you won't be able to do that in a formula field, you van only do it with an Apex trigger.
This was selected as the best answer