function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KitagawaSan85KitagawaSan85 

Display Chatter for Multiple Entities

Is it possible to show the chatter feedItems for multiple entities? 

 

We post relevant news stories to chatter on the account record, but would like the ability to show all Chatter posting for that greater account hierarchy... 

 

I have a controller extension to get the chatter postings:

public integer getChatter() {
       List<Account> Accounts = [SELECT ID from Account WHERE Rep_Site_ID__c = :acc.Rep_Site_ID__c];
       List<ID> Chatters = new List<ID>();{
           for( FeedItem FI : [SELECT ID,Body FROM feedItem WHERE parentID IN :Accounts and (type='TextPost' or type='linkpost')]) {
               if( FI.body.toUpperCase().contains('#CRTNEWS')) {
                   Chatters.add(FI.id);
                   }}}
       if( acc.NA_Code_EU__c == null ) 
           {return [SELECT count() from AccountFeed WHERE ParentID = :acc.ID];}
           else
           if( Accounts == null && Chatters == null) 
              {return 0;} 
              else 
              {return [SELECT count() FROM AccountFeed WHERE ParentID  IN :Accounts and ID IN :Chatters];}
        
    }

 This just returns the # of postings, but I am not quite sure how I would display this in VF. 

 

the <chatter:feed> tag can only show a single entity... any ideas?