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 InteractionisVisible()ResponseThis method is asynchronous so it returns its response in an object in a callback method. The response object contains thefollowing fields:NameresulterrorTypebooleanstringDescriptiontrue if the SoftPhone was in the <strong>Salesforce</strong> console, false if the SoftPhonewasn’t in the <strong>Salesforce</strong> console.If the API call was successful, this variable is undefined. If the API call failed,this variable returns an error message.isVisible()UsageReturns true if the SoftPhone is visible or false if the SoftPhone is hidden.Syntaxsforce.interaction.isVisible(callback:function)ArgumentsNamecallbackTypefunctionDescriptionJavaScript method called upon <strong>com</strong>pletion of the method.Sample Code–JavaScriptvar callback = function (response) {if (response.result) {alert('SoftPhone is visible');} else {alert('SoftPhone is not visible');}};function isVisible() {sforce.interaction.isVisible(callback);}isVisible18

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

Saved successfully!

Ooh no, something went wrong!