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
kush1234kush1234 

Subscribing to publisher.customActionMessage doesn't work

I have a custom Knowledge Bar console component that publishes event named "publisher.customActionMessage". And then I've two custom publisher actions for Case Feed that subscribe to this event. Following is the code:
 
// code in KnowledgeSidebar.page
Sfdc.canvas.publisher.publish({ name:"publisher.customActionMessage", payload: { actionName: "CaseSMSPublisher", message: "Hello world" } });

// code in CaseSMSPublisher.page
Sfdc.canvas.publisher.subscribe([{
        name: "publisher.customActionMessage",
        onData: function(e) {
          alert(e.message);
        }
      }]);
I've enabled logging and it shows that the event is being fired when clicking on a button in the sidebar, but the custom publisher action neither show any alert message nor prints in the console. It would be great if someone could help out.
 
kush1234kush1234
Any help would be really appreciated. Thanks!
jhennyjhenny
When you publish, make sure the actionName attr corresponds to an actual action you have created for case, and prefix it with "Case.", i.e. assuming you created an action on case called CaseSMSPublisher:
Sfdc.canvas.publisher.publish({ name:"publisher.customActionMessage", payload: { actionName: "Case.CaseSMSPublisher", message: "Hello world" } });