12.07.2015 Views

Open CTI Developer's Guide - Salesforce.com

Open CTI Developer's Guide - Salesforce.com

Open CTI Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methods for <strong>Salesforce</strong> Application InteractionrefreshPage()Syntaxsforce.interaction.onFocus( listener:function );ArgumentsNamelistenerTypefunctionDescriptionJavaScript method called when the browser focus changes.Sample Code–JavaScriptvar callback = function (response) {if (response.result) {alert(response.result);}};//Invokes API methodsforce.interaction.onFocus(callback);ResponseThis method is asynchronous so it returns its response in an object in a callback method. The response object contains thefollowing fields:NameresulterrorTypestringstringDescriptionReturns the URL of the page in focus as a JSON string, and includes anyapplicable object ID, object name, and object type. For example:{"url":"http://salesforce.<strong>com</strong>/001x0000003DGQR","objectId":"001x0000003DGQR","objectName":"Acme","object":"Account"}If the page isn’t focused on an object, the object ID, object name, and objectwill be empty.If the API call was successful, this variable is undefined. If the API call failed,this variable returns an error message.refreshPage()UsageReturns true if page refresh is invoked, false otherwise. When this method is called within the <strong>Salesforce</strong> console, itrefreshes the current active tab. This method is only available in API version 28.0 or later.20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!