Newer Version Available

This content describes an older version of this product. View Latest

Why Your UI Matters

The Lightning Console JavaScript API provides much of the same functionality as the Salesforce Console Integration Toolkit, but in Lightning Experience only. The user interface of your org dictates which development tools you can use with the Salesforce console.

What’s the Difference Between the Lightning Console JavaScript API and the Salesforce Console Integration Toolkit?

Both the Lightning Console JavaScript API and the Salesforce Console Integration Toolkit are JavaScript APIs that allow you to interact with the Salesforce console. Methods are implemented differently in each API, however.

You use the methods in different places

When you are using the Lightning Console JavaScript API in Lightning Experience, you use methods in the JavaScript controller of a Lightning component. You can’t use the Lightning Console JavaScript API in Visualforce pages or other iframed pages within a Lightning console app.

When you are using the Salesforce Console Integration Toolkit in Salesforce Classic, you use methods within <script> tags on a Visualforce page.

The input syntax for methods is different
Methods in the Lightning Console JavaScript API take a JSON array of arguments:
1workspace.openTab({
2    url: 'https://salesforce.com', 
3    focus: true, 
4    label: 'Salesforce',
5});
Methods in the Salesforce Console Integration Toolkit don’t:
1sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false, 
2                'salesforce', openSuccess, 'salesforceTab');
The two APIs provide different methods

Although some of the methods in the Lightning Console JavaScript API are similar to methods in the Salesforce Console Integration Toolkit, they have different names and provide different functionality.

The Lightning Console JavaScript API also provides methods for use with the utility bar, which is available in Lightning Experience only.