You need to sign in to do that
Don't have an account?
RiverChaser
Accessing Field History for Contacts and Accounts
I've turned on field history for selected fields in the Account and Contact objects, as well as in a couple of custom objects.
Now I need to access the history from an external application. Custom objects are easy (and slick): just read and process the contents of the object's history table, such as Membership__History.
I can find no such history tables for Account and Contact. Some standard objects have tables with names like CaseHistory, but not Account and Contact. I also don't see where it might be hiding within the objects themselves, but it's certainly possible that I've not used the right tool or query.
How can I get access to Account and Contact history?
Thanks,
Don
Now I need to access the history from an external application. Custom objects are easy (and slick): just read and process the contents of the object's history table, such as Membership__History.
I can find no such history tables for Account and Contact. Some standard objects have tables with names like CaseHistory, but not Account and Contact. I also don't see where it might be hiding within the objects themselves, but it's certainly possible that I've not used the right tool or query.
How can I get access to Account and Contact history?
Thanks,
Don
All Answers
Here is the schema:
The problem I'm having now is that I'm writing code like this (C# in a .NET application, not that that is relevant):
If I include CreatedBy in the field list, I get an error that it doesn't exist in Account History. If I include CreatedBy.Name, I sort of get a result, but it is buried deep in a apex.Name object and I have to extract it from that.
I think I'm in a new area of SOQL here. Is there another syntax I should be using?
I'll keep inching along....
Don
Below is the code that is working for this. Note this is rough draft code, and I'm not yet filtering for the start and end dates. What's weird about it is that I have to return Account.Name as well as CreatedBy.Name, but in the case of the former I read the Account.Name property of the ah object, but CreatedBy.Name1. I haven't figured out why that is yet.
Right now using a DataSet is just a convenience. I haven't figured out what I'm actually going to return from this function.
Progress, inch by inch!
Don
Yep, that's probably why I hadn't noticed them. I only update the WSDL files when I need to.
Thanks,
Don