[SalesForce] How to refresh the chatter feed or feed item automatically

When i create a feed item through APEX, the chatter feed does not show immediately unless i refresh the chatter page or click the Feed link in the left navigation on the chatter page.

  1. Is there a way to refresh a particular feed item either through APEX or any setting?
  2. If the above one is not possible, is that possible to refresh the entire chatter page automatically?

Any suggestions please.

Best Answer

This isn't supported by Salesforce and they could change their code to break this, but I've been successful in refreshing the Chatter feed with Javascript.

if (window.chatter) {
    var feed = chatter.getFeed();
    var feedConfig = feed.getConfig();
    feed.refresh({
        feedType : feedConfig.feedType,
        isFullRefresh : true,
        params : feedConfig
    });
}
Related Topic