You need to sign in to do that
Don't have an account?
Eric Fortenberry
Task.Who.Phone and .Email
Does anyone know if there's any sort of reason why I wouldn't be able to render Task.Who.Phone and Task.Who.Email on a visualforce page? I tried to use an outputfield, but nothing shows up. Any ideas or guidance would be appreciated.
In your controller define properties and set them:
and in your controller refer to the two properties:
All Answers
Hey Eric,
It might be the case because whoid is refering to more than one objects (Contact or Lead).
Due to which page is unable to fetch value from exact object. Seems you need to write custom code for the functionality.
Here is the custom code I have, but I'm not sure I'm defining the phone field correctly and I'm not sure how to access it from the visualforce page.
Custom controller code (see last block of code):
Visualforce code trying to access the phone field:
Entire Visualforce Page:
Eric,
Your appoach is correct . But you need to define two properties in your extension for holding email and phone of reference field, use them in visualforce page to display fields values.
Rahul,
Would you mind elaborating a little more? I was attempting to have phone be the property (variable) used to store the phone, but then I wasn't sure how to access that in the visualforce page. I understand I can't use Task.Who.Phone, but anything else I tried to plug in gave me an error saying it wasn't a Task SObject.
Thanks for your help.
In your controller define properties and set them:
and in your controller refer to the two properties: