Reply
Visitor
Ken Hall
Posts: 1
0

Help with Simple SOQL Query [Objects: user and userfeed]

Alert: Very new to SF

 

I've added a custom field to user object: Chatter_Prime__c (values true/false)

 

I want to list user name and userfeed comments by users whose Chatter_Prime__c = true

 

Would somebody be so kind as to create this simple query?

 

I have been running into a brick wall (also known as my thick head).

 

Thanks

 

 

Super Contributor
Jia Hu
Posts: 839
0

Re: Help with Simple SOQL Query [Objects: user and userfeed]

Try the query below,

Map<Id, User> umap = new Map<Id, User>([Select Id From User Where Chatter_Prime__c = true]);
Set<Id> uid = umap.keySet();
List<UserFeed> uflist = [Select Id, Body, Createdby.Lastname, Createdby.Firstname, (Select Id, CommentBody from FeedComments) from UserFeed Where CreatedById IN:uid ];