function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Westec Intelligent Surv.Westec Intelligent Surv. 

Opportunity Field History - Query error on a field that exists in the WSDL

I'm trying to get a list of field histories for an Opportunity, including who made the change and when. I see the CreatedBy and CreatedDate fields for the OpportunityFieldHistory entity in my WSDL, and therefore I can also see the properties in my generated Salesforce domain. However, when I try to specify them as fields to select on or filter by in the query, I get an INVALID_FIELD error that the table doesn't have these fields. The documentation for this table does not include the fields. The remaining info is useless to me and my users without these two fields. My WSDL was generated against version 20.0 of the API. What's going on here?

SuperfellSuperfell

Can you post your specific query, i was able to run this query fine. 

select Id, IsDeleted, OpportunityId, CreatedById, CreatedDate, Field, OldValue, NewValue from OpportunityFieldHistory

 

 

 

JPClark3JPClark3

The History Records are different sObjects as you can tell by Simon's query. You can use the WHERE clause to specify which field names you want to look at. Remember that the field names aren't the labels. I'm not sure if the field names contain the namespace. But if you look at the results of Simon's query you'll see the format of the names.