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
moverdorfmoverdorf 

Getting the Task Id for an OpenActivity row..

I have the following code that simply gets Open Activities for a passed in Client Id list:

 

SELECT name,(SELECT id,ActivityDate,Description,Subject,IsClosed,CallType,CallDisposition,Status,ActivityType

FROM OpenActivities Where (ActivityDate > :myDate and ActivityDate <= :myDate2 ) Order by ActivityDate desc)

FROM Account Where Id = :myClientIdList';

 

I have a requirement to create a hyperlink that when the Subject info is clicked in my VF page, it will send the user to the Task panel so they can see the detail.

 

What I need is for each row returned from my SOQL, I need to get the Task Id to use in a hyperlink that when clicked will send the user back to

my Task panel for the Task Id selected. I am not seeing anywhere how to get the Task Id value. I can get the Account Id, and it's related OpenActivities Id, but am at a loss for how to link these to a task id.

 

Thanks in advance for any help!

Best Answer chosen by Admin (Salesforce Developers) 
kevin lamkevin lam

There is an IsTask field that you can add to your filter of OpenActivities to filter out those that are tasks.

All Answers

kevin lamkevin lam

There is an IsTask field that you can add to your filter of OpenActivities to filter out those that are tasks.

This was selected as the best answer
moverdorfmoverdorf

Thank you works perfectly!