Salesforce Console Integration Toolkit allows developers to customize the Console and integrate 3rd party systems with the console. The development guide shows several examples that are very useful. These examples use a Visual Force page, which employs Smart HTML. This means that the load order of scripts and components won’t matter. Smart HTML takes this into consideration, and can locate scripts that may be loaded later that are needed by a CTI method.
In use cases where a button is used to implement a CIT method, javascript is often used to script the button. In these cases, regular HTML means that the order of load must be considered. Look at these two examples:
CTI Developer Guide Example using Visual Force Page:
<apex:page standardController="Case">
// Note that method is called before script is loaded- Works fine in Visual Force page!
<A HREF="#" onClick="testOpenPrimaryTab();return false">
Click here to open a new primary tab</A>
<apex:includeScript value="/support/console/38.0/integration.js"/>
<script type="text/javascript">
function testOpenPrimaryTab() {
//Open a new primary tab with the salesforce.com home page in it
sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false,
'salesforce', openSuccess, 'salesforceTab');
}
var openSuccess = function openSuccess(result) {
//Report whether opening the new tab was successful
if (result.success == true) {
alert('Primary tab successfully opened');
} else {
alert('Primary tab cannot be opened');
}
};
</script>
</apex:page>
Example for Javascript, like you might use for button script:
{!REQUIRESCRIPT("/support/console/38.0/integration.js")}
var openSuccess = function openSuccess(result) {
//Report whether opening the new tab was successful
if (result.success == true) {
alert('Primary tab successfully opened');
} else {
alert('Primary tab cannot be opened');
}
};
// Notice here that method is called AFTER script is loaded. Javascript needs this!
sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false, 'salesforce', openSuccess, 'salesforceTab');
Summary: When using CTI Developer Guide examples outside of a Visual Force page, be sure to consider the order of loading so that scripts are loaded before methods that need those scripts are called. 000383520

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.