0

Here is the document https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_onfocus.htm

The method is supposed to add a listener to call when the browser focus changes. However, it never gets call when I switch between tabs in the console.

Here is my js code

var callback = function (response) {
    if (response.result) {
        alert(response.result);
}};
sforce.interaction.onFocus(callback);
2
  • provide your full code here Commented Jan 24, 2017 at 18:38
  • That code will only run within the context of the window it was called in. It won't be active when you change tabs if you're referring to a different browser tab.
    – crmprogdev
    Commented Jan 24, 2017 at 18:38

1 Answer 1

0

Are you calling sforce.interaction.onFocus(callback); code?

You need to call sforce.interaction.onFocus(callback); as mentioned in the docs link you provided.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .