0

I want to retrieve data from "FeedTrackedChange" table between particular time period. For Example:

select * from FeedTrackedChange where CreatedTime >= jan 2000

But the problem here is there is no timestamp field for "FeedTrackedChange" table. I believe 'FeedItem' table is the parent table of FeedTrackedChange which is having 'CreatedDate' field. Can we create something like

select * from FeedTrackedChange where FeedTrackedChange.feeditemid in (select id from FeedItem where createdDate <= Starttime AND CreatedDate > Endtime)

Kindly help me here. Thanks in advance

0

You can use SOQL to retrieve the FeedTrackedChange object but not directly. This means you need to query the FeedTrackedChange object via the parent feed object.

Lets say we want to focus on querying the FeedTrackedChanges from the AccountFeed and we are interested in the field which has been changed, its old and new values & the created date of the AccountFeed.

SELECT Id,
    (Select FieldName, OldValue, NewValue FROM FeedTrackedChanges),
    CreatedDate
FROM AccountFeed
WHERE (createdDate <= Starttime
AND CreatedDate > Endtime)

As you have mentioned, there is no way timestamp on the FeedTrackedChanges object but the CreatedDate on AccountFeed should be enough for what you need.

2
  • Thanks for your fast response Smith. I will try this SELECT Id, (Select FieldName, OldValue, NewValue FROM FeedTrackedChanges), CreatedDate FROM AccountFeed where CreatedDate>=Starttime AND CreatedDate<Endtime Thank you so much. – siva Sep 3 '18 at 9:54
  • Parent table for FeedTrackedChange is 'AccountFeed' or 'FeedItem'. @TSmith – siva Sep 3 '18 at 10:04

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.