Is there a way to query the account history using php and the API? I have some accounts that got updated unnecessarily and I need to view the history to programmatically update them all back to their correct stage. Any help is appreciated. Thanks!
1 Answer
Yes, every object with history tracking enabled has queryable shadow object. In this case it's simply AccountHistory
.
Just experiment with query similar to this
SELECT AccountId, Account.Name, CreatedBy.Name,CreatedDate,Field, OldValue,NewValue
FROM AccountHistory
ORDER BY AccountId, CreatedDate DESC