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
@ M  Coder@ M Coder 

SOQL on Open Activities

How to write a soql query to get All the records in Open Activites which are related list to a account.

User-added image 

 
RituSharmaRituSharma
Activities are technically split into tasks and events.You may use a query like below:

Select Id,(Select id,Subject from Tasks),(Select Id,Subject from Events) from Account where Id='0017F00002bJiMU'
RituSharmaRituSharma
Did the query that I shared work for you? If yes, please mark my answer as the best answer so that it's helpful for others too. Thanks!
@ M  Coder@ M Coder
Thanks Ritu for helping me out