13

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,

1
  • 2
    Using the force.com explorer I was able to find the solution. Select Id, Name, (Select NewValue From Histories) From Custom_Object__c Hope this may help anyone else with this issue. Sep 11 '12 at 16:10
21

Child history table name is common and is "histories", This SOQL should work :

Select Id, Name, (Select NewValue From Histories) From Custom_Object__c
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.