• kush1234
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
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.
 
I have been struggling to add a display name along with email address when specifying fromAddres attribute for emailPublisher. This is both the case when creating a custom publisher component or when specifying fromAddress in edit feed page layout. My goal is to use a default email address for all case emails. And it isn't possible to set an org-wide email address as the default from address, so I used fromAddress attribute, but the problem is that the from email address shows something like this: "support@keeptruckin.com <support@abc.com>" whereas I want it to be "Abc Support <support@abc.com>"
I have been struggling to add a display name along with email address when specifying fromAddres attribute for emailPublisher. This is both the case when creating a custom publisher component or when specifying fromAddress in edit feed page layout. My goal is to use a default email address for all case emails. And it isn't possible to set an org-wide email address as the default from address, so I used fromAddress attribute, but the problem is that the from email address shows something like this: "support@keeptruckin.com <support@abc.com>" whereas I want it to be "Abc Support <support@abc.com>"
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.
 
I have a custom Visualforce page as a Publisher Action that looks like this:
 
<apex:page controller="PageController" action="{!Init}" >

	<apex:includeScript value="/support/console/31.0/integration.js" /> 
	<apex:includeScript value="https://code.jquery.com/jquery-1.7.1.js" />
    
	<apex:form>
        
        <apex:actionFunction action="{!Init}" name="refresh" reRender="ContainerToBeRefreshed"/>
		
		<apex:outputPanel id="ContainerToBeRefreshed" layout="block">
			...
		</apex:outputPanel>
		
	</apex:form>
		
	<script type="text/javascript">
	$(function(){
		function eventHandler(msg){
			var focusedPrimaryTabId = msg.message;
			sforce.console.getEnclosingPrimaryTabId(function(result){
				var enclosingPrimaryTabId = result.id;                   
				if(focusedPrimaryTabId === enclosingPrimaryTabId){                       
					refresh();
				}
			});                
		};
		sforce.console.addEventListener('EventName', eventHandler);
		
		sforce.console.onFocusedSubtab( function ( result ) {        
			refresh();
		});
    });
	</script>
	
</apex:page>

Previously this enabled me to dynamically refresh the visualforce page when the user switched between (primary or sub) tabs in Service Console.

This no longer works. On loading the publisher action I see the following message written to the developer console from ServiceDesk.js.

addEventListener: Unsupported Operation: This API cannot be used on this component.

Is the API no longer available for use within a publisher action? Or is there an alternative way to do this?