2

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.

  • How are you triggering the creation of the feed item in Apex, is it a button on your page or an automated process? – Alex Tennant Aug 14 '14 at 8:44
  • Thanks @AlexTennant. It is a automated process. The process is when a sales order blocked in SAP, that event called sfdc custom webservice and create the feed items. – Bforce Aug 14 '14 at 11:11
  • So what exactly do you want to refresh? Everyone's Chatter pages that are currently open? – Alex Tennant Aug 14 '14 at 11:21
  • The user for which the chatter feed created recently is to be refreshed. – Bforce Aug 14 '14 at 12:17
2

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
    });
}

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.