Query to get any record update history #inSalesforce

Query to get any record update history :

Suppose you want to track the owner change of Lead Record:

Prerequisite accordingly: Make sure that the Field History Tracking is checked for Lead Owner on the update of which, the history will be tracked for the owner and can reflect in the query. Similarly, you can try for other fields and also in other objects

Sample Query looks like this:

SELECT id, OldValue, NewValue, Field FROM LeadHistory WHERE LeadId = '00Q........'
SELECT id, OldValue, NewValue, Field FROM AccountHistory WHERE AccountId = '001........'

Comments