Pages

Tuesday, August 6, 2013

Salesforce: FeedTrackedChange

In previous blog, we touch on FeedTrackedChange object, this object is use to store individual field change, with information: FieldName, OldValue, NewValue. A FeedTrackedChange is a child object of a record feed, such as AccountFeed, ContactFeed, etc. This object is available in API version 18.0 and later.

Although this object is query-able as it said in the SOAP API Developer's Guide.


But, if you look at Force.com IDE, there is no access to this object.


What does it mean? Meaning you cannot query this object directly. See this query:
SELECT FieldName, OldValue, NewValue FROM FeedTrackedChanges
Above query will throw error 'sObject type FeedTrackedChanges is not supported'.

FeedTrackedChange records for standard feeds can only be queried via the parent feed object. A standard feed is a record feed, such as AccountFeed. Sample:

SELECT Id, ParentId, (Select FieldName, OldValue, NewValue FROM  FeedTrackedChanges), CreatedDate FROM AccountFeed WHERE ParentId = '0015000000o0WUd' 

OR

SELECT Id, ParentId, (Select FieldName, OldValue, NewValue FROM  FeedTrackedChanges), CreatedDate FROM FeedItem WHERE ParentId = '0015000000o0WUd'





Reference: FeedTrackedChange