I'm trying to pull the history records of a custom object with an inner query.
Here is the sample:
Select Id, Name, (Select NewValue From Custom_Object__History) From Custom_Object__c
Based on the documentation here
This should work.
example in documentation:
SELECT Name, customfield__c, (SELECT OldValue, NewValue FROM foo__history)FROM foo__c
Any help is appreciated.
Thanks,
Attribution to: Jonathan Jenkins
Possible Suggestion/Solution #1
Child history table name is common and is "histories", This SOQL should work :
Select Id, Name, (Select NewValue From Histories) From Custom_Object__c
Attribution to: Abhinav Gupta
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1352