+ Start a Discussion
MiddhaMiddha 

Parent Name from FeedComments object

Hi , I am trying to figure out the name of user who commented on a feed but unfortunately i am not able to make a query:

 

"Select u.Id,u.Parent.Name,  (Select ParentId From FeedComments) From UserFeed u" WORKS but when it does not allows me to create a parent relationship in inner query but it works on parent query.

 

"Select u.Id,u.Parent.Name, (Select ParentId,Parent.Name From FeedComments) From UserFeed u" gives an error.

 

Is there anything wrong in this query? I donot want to collect the Parent Ids and fetch names from User object in another query.

 

Any solutions please?

rwoollenrwoollen

The comment author is the CreatedBy field on FeedComment.  (You may want to select CreatedBy.FirstName and CreatedBy.LastName).

 

Have a look at recipe #7 in this article for an example:  http://wiki.developerforce.com/index.php/Chatter_Code_Recipes

 

-- Rob