Select op.Id, op.Name, op.Install_Date__c, op.Scheduled_Go_Live_Date__c,
(SELECT Id, Field, OldValue, NewValue, OpportunityId FROM OpportunityFieldHistory)
FROM Opportunity op WHERE op.Scheduled_Go_live_Change_Count__c != 'null' AND op.Scheduled_Go_live_Change_Count__c != '' AND op.Boolean_check_install_date__c =
Here's my issue.
I have had fields modified in....600-800 opportunities, that WHERE is the check to see if they have been modified. What I want to do is pull the opphistory (it's an object that has a field opporunityId that matches with the opportunity object Id field it also has the old data)
So how would I go about getting the old data on the op.Install_Date__c and the op.Scheduled_Go_Live_Date__c fields from the opportunity? Because my SOQL statement comes up with this error:
NewValue, OpportunityId FROM OpportunityFieldHistory) FROM Opportunity ^ ERROR at Row:1:Column:136
Didn't understand relationship 'OpportunityFieldHistory' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.