+ Start a Discussion

whoId in Open activities table


I am using below query to fetch open activities and display them in my VF page. But,

The whoId is never retrieved in my query result as a result the name field is coming blank in my VF page . Can anyone help me.

select id,ownerId,(select id,isTask,whatid,What.Name,WhoId,activitydate,createdbyid,description,subject,
OwnerId,Status,Priority,LastModifiedDate from openActivities WHERE createdbyid=:userId ORDER BY activitydate ASC , LastModifiedDate DESC LIMIT 500 ) from account where id ='XXXXXXXXXXXXXXX'

I eventually want to display the the name as who.name like i am doing here for whatId as what.name

Best Answer chosen by sfdcraj
I Got this one...

Actually the contact name is saved in a field called "PrimaryWhoId" in OpenActivities table . I changed my query accordingly and it worked.