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
Big EarsBig Ears 

Custom Action Publisher - How to refresh the record?

Hey all,

I'm making some changes to my case feed page, so that the Custom Actions can appear in the Publisher. My custom actions are Visualforce pages that used to accept some values and update the record feed and refresh the page. I followed the documentation and used the interaction Javascript library function:
<apex:actionFunction name="emailSent" oncomplete="sforce.interaction.entityFeed.refreshObject('{!feedCase.id}','true','true','true')"/>
This javascript function refreshes the fields, related lists and feeds all in one go. However, it doesn't appear to work when the Custom Action is being invoked from the Publisher. Simply, nothing happens.

I have found this Javascript function from the Canvas Javascript library which seems to work, but doesn't do what I want it to:
<apex:actionFunction name="emailSent" oncomplete="Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:true}});"/>
This function refreshes the feed, but not the fields or related lists. As a result, the highlights panel at the top of the page doesn't update, either, which my users look to as an indicator that the record has been updated. They shouldn't have to force a refresh of the page to check.

I can't find anything in the documentation that lists the elements I can put into the payload, so I'm not sure what the situation is:
  • The Initial Code sample should have continued to work in the Custom Action Publisher, keep debugging to find out why it didn't.
  • The Initial Code sample doesn't work in the Custom Action Publisher. However, the new code sample can be used to refresh more than the feed.
  • The initial Code sample doesn't work in the Custom Action Publish and the new code sample can only refresh the feed. Find another way to refresh the fields and related lists
Does anybody know?

Best Answer chosen by Big Ears
Big EarsBig Ears
Found the answer after a little experimentation:

Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed: true, objectFields: true, objectRelatedLists: {}}});

I couldn't find this anywhere in the documentation. Is it somewhere I've not been able to see?

Andy

All Answers

Big EarsBig Ears
Found the answer after a little experimentation:

Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed: true, objectFields: true, objectRelatedLists: {}}});

I couldn't find this anywhere in the documentation. Is it somewhere I've not been able to see?

Andy
This was selected as the best answer
Lawrence Coffin (P)Lawrence Coffin (P)
I'm trying to get this to work, but can't get the record detail to refresh. The "feed: true" part updates the Chatter feed, but the "objectFields: true" doesn't seem to do anything. Has this changed since this post was last updated? Or is this still working for others?

Is there some other way for a visualforce quick action used in the chatter publisher to force a refresh of the parent detail page?

-L
Barry FlashBarry Flash
Hey thanks this post has  helped me a lot. This was very informative. I had the same isses. But now they are fixed. Thanks a lot.