Thursday, August 8, 2019

How to get activity history of a object using SOQL in Salesforce

ActivityHistory is a standard object is displayed in a related list of closed activities—past events and closed tasks—related to an object.

SOQL Query
SELECT Id, (SELECT Id, Subject, CreatedDate FROM ActivityHistories WHERE CreatedDate = LAST_N_DAYS: 90) FROM Account WHERE Id = '001G000001uoKEL'
Result

Resource
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_activityhistory.htm

No comments:

Post a Comment