1

Is there a bug on the when querying the FieldHistoryArchive table?

Background:

The FieldHistoryArchive table is neither available from dataloader nor dataloader.io So I had to go with Workbench on this one.

When querying the FieldHistoryArchive (whether you turn on include archived records or not), your query result will only show certain fields of the query based off of the other fields that were included in your query. Additionally, it seems that workbench cannot resolve the field names for NewValue and OldValue.

For example, and my use case, when I use this query:

SELECT Id,NewValue,OldValue,ParentId FROM FieldHistoryArchive

My columns in the result are

Id    Unknown_Field__1    Unknown_Field__2    ParentId

and the data from the query successfully displays.

However if I use the query:

SELECT Field,Id,NewValue,OldValue,ParentId FROM FieldHistoryArchive

My columns in the result are

Field    Id    ParentId

and the OldValue and NewValue are skipped completely!

Is this a bug?

3

It seems this is a bug, although I did not confirm this with Salesforce.

I'm not sure why the fields are unresolved and display as

Unknown_Field__1    Unknown_Field__2

But when I change the order of the fields in the query to

SELECT Id,NewValue,OldValue,ParentId,Field FROM FieldHistoryArchive

I get all of the columns I needed!

Id  Unknown_Field__1    Unknown_Field__2    ParentId    Field

Strange indeed.

1
  • It seems that this query no longer works in workbench. You get an error: "sObject type 'FieldHistoryArchive' is not supported." – Shmuel Kamensky Apr 4 '17 at 15:53

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.