0

As per my understanding, custom console component(VF page) at footer, loads after parent window get loaded. So on load Javascript funtions, in custom console component can only work on load/refresh of main agent console window.

My requirement is little different. Content of my custom console component is different for each subtab(different Case records).So I want as soon as I change subtab, custom console component is refreshed so that it start showing content relevant to that subtab(case).(see Image below) enter image description here

I checked multiple articles: all of them shows, Javascripts functions are available in custom console component to get ID of subtab(i.e Case) to get different content. But questions is how to execute those on-load javascript functions, if custom console is already loaded and you're moving from one subtab to another.

For this, I can think, I need to refresh the custom console component(footer component) as soon as move or focus to another sub tab, which I'm unable to do till now

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_methods_classic.htm

1

You can perform some action when a new subtab is selected via sforce.console.onFocusedSubtab. It looks like this:

sforce.console.onFocusedSubtab(
  result => doSomething({ objectId: result.objectId, subtabId: result.id })
);

Where doSomething is the method that you want to call when a new subtab is selected. If you just want to reload your own component, it should be as simple as:

sforce.console.onFocusedSubtab(result => window.location.reload());
  • Hi sfdcfox- thanks for replying. Please Correct me if I'm wrong, sforce.console.onFocusedSubtab is called when custom console component is loaded(at time of load of whole page). Now when custom console is ALREADY loaded and after that, I'm moving from one sub-tab to another; how javascript in custom console component(at footer) will catch that event, i.e i mean, how that javascript will get executed ? – sfdc_Qrius Mar 3 '18 at 15:20
  • @sfdc_Qrius the onFocusedSubtab method attaches a cross-domain event handler that triggers when the subtab changes. It is not called when the console initially loads. – sfdcfox Mar 3 '18 at 15:43
  • Thanks for clarification! I just checked this. onFocusedSubtab indeed is called when subtab is changed. But only for the FIRST TIME. Suppose you refresh a console window which already has two sub tabs opened. After load is completed, a particular sub tab is focussed. Now if you move to 2nd subtab, seems like that sub tab is loaded at that point of time and 'onFocusedSubtab' method is CALLED. But now if you click on first sub-tab, then unfortunately it NOT getting called. so I'm not able to change content of footer console component based on current focussed(Selected) subtab.any idea pls! – sfdc_Qrius Mar 3 '18 at 16:15
  • My scenario is : suppose multiple sub tabs are already opened in service cloud console, agent is moving frequently from one sub tab to another- Any time it click on custom console component(at footer), it should show only relevant content belonging to that particular sub tab. Agent is also supposed to take action in the custom console component(VF) page. – sfdc_Qrius Mar 3 '18 at 16:25
  • Hi sfdcfox- waiting to get any idea on this..from experienced minds like you. Otherwise, would move to some other solution. Please revert if you've any doubt on my question above !. thanks! – sfdc_Qrius Mar 4 '18 at 8:39

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.