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.

Working with <strong>Open</strong> <strong>CTI</strong>Best Practices• To retrieve the entity ID of the record that is associated with the canvas sidebar <strong>com</strong>ponent, do the following:// Get signedRequestvar signedRequest = Sfdc.canvas.client.signedrequest();var parsedRequest = JSON.parse(signedRequest);// get the entity Id that is associated with this canvas sidebar <strong>com</strong>ponent.var entityId = parsedRequest.context.environment.parameters.entityId;• To retrieve the entityId for OAuth, do the following:var entityId = msg.payload.environment.parameters.entityId;To see an example on how to retrieve msg.payload, see “Getting Context in Your Canvas App” in the Force.<strong>com</strong> CanvasDeveloper’s <strong>Guide</strong>.Best Practices• Since many of the methods in <strong>Open</strong> <strong>CTI</strong> are asynchronous and return their results using a callback method, <strong>Salesforce</strong>.<strong>com</strong>re<strong>com</strong>mends that you refer to the documentation for each method to understand the information for each response.• Errors generated by <strong>Open</strong> <strong>CTI</strong> are typically emitted in a way that doesn't halt JavaScript processing. Therefore,<strong>Salesforce</strong>.<strong>com</strong> re<strong>com</strong>mends you use a tool such as Firebug for Firefox to monitor the JavaScript console and to help youdebug your code.• For information on customizing, extending, or integrating the sidebars of the <strong>Salesforce</strong> console using Visualforce, see“Custom Console Components Overview” in the <strong>Salesforce</strong> online help.14

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

Saved successfully!

Ooh no, something went wrong!