Why Your UI Matters. salesforce Salesforce Console
Oglas
Oglas
CHAPTER 2
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.
Note: The Lightning Console JavaScript API is available as a developer preview. The Lightning Console JavaScript API isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements.
We can’t guarantee general availability within any particular time frame or at all. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don’t implement functionality developed with these commands or tools.
We also provide the Lightning Console JavaScript API to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the Lightning Console JavaScript API in the IdeaExchange .
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’s workspace API take a JSON array of arguments: workspace.openTab({ url: 'https://salesforce.com', focus: true, label: 'Salesforce',
});
Methods in the Salesforce Console Integration Toolkit don’t: sforce.console.openPrimaryTab(null, 'http://www.salesforce.com', false,
'salesforce', openSuccess, 'salesforceTab');
2
Why Your UI Matters Console API Method Parity—What’s Different Between
Lightning Experience and Salesforce Classic?
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.
IN THIS SECTION:
Console API Method Parity—What’s Different Between Lightning Experience and Salesforce Classic?
The Lightning Console JavaScript API provides methods similar to those methods in the Salesforce Console Integration Toolkit.
SEE ALSO:
Lightning Console JavaScript API for Lightning Experience (Pilot)
Salesforce Console Integration Toolkit for Salesforce Classic
Console API Method Parity—What’s Different Between Lightning
Experience and Salesforce Classic?
The Lightning Console JavaScript API provides methods similar to those methods in the Salesforce Console Integration Toolkit.
This table shows which Salesforce Console Integration Toolkit (Salesforce Classic) methods map to Lightning Console JavaScript API
(Lightning Experience) methods and events. Not every Salesforce Console Integration Toolkit has a Lightning analog. Some Salesforce
Console Integration Toolkit methods can be replicated by using Lightning events, combining methods from the Lightning Console
JavaScript API, or using iterative and conditional logic with methods and events.
Important: Only Salesforce Console Integration Toolkit methods with a Lightning Console JavaScript API or workaround appear in this table. Methods without alternatives or workarounds are not listed.
Methods for Primary Tabs and Subtabs
Lightning Console JavaScript API Method (Lightning Experience) Salesforce Console Integration Toolkit
(Salesforce Classic)
Not supported.
Workaround: Call getTabInfo()
on the tab in question. If response.isSubtab
is true, store response.parentTabId
. Call getTabInfo()
using the parentTabId
.
3
Why Your UI Matters
Salesforce Console Integration Toolkit
(Salesforce Classic)
getEnclosingPrimaryTabObjectId()
getFocusedPrimaryTabObjectId()
Console API Method Parity—What’s Different Between
Lightning Experience and Salesforce Classic?
Lightning Console JavaScript API Method (Lightning Experience)
Not supported.
Workaround: Call getTabInfo()
on the tab in question. If response.isSubtab
is true, store response.parentTabId
. Call getTabInfo()
using the parentTabId
.
Not supported.
Workaround: Call getTabInfo()
on the tab in question. If response.isSubtab
is true, store response.parentTabId
. Call getTabInfo()
using the parentTabId
.
getFocusedTabInfo() getFocusedTabInfo() getFocuseTabInfo()
Not supported.
Workaround: Call getAllTabInfo()
, iterate through the response
, and save tabIds
for which isSubtab
is false.
Not supported.
Workaround: Call getAllTabInfo()
, iterate through the response
, and save tabIds
for which isSubtab
is true.
force:tabRefreshed force:tabFocused
Not supported.
Workaround: Call getFocusedTabInfo()
to get the current focused tab’s tabId
. Then use force:refreshview
to focus the tab you want to refresh, and call focusTab()
with the tabId
you got.
4
Why Your UI Matters Console API Method Parity—What’s Different Between
Lightning Experience and Salesforce Classic?
Methods for Navigation Tabs
The force:navigateToObjectHome
Lightning event allows you to complete actions analogous to many navigation tab methods in Salesforce Classic.
Salesforce Console Integration Toolkit
(Salesforce Classic)
refreshNavigationTab() setSelectedNavigationTab()
Lightning Console JavaScript API Method (Lightning Experience)
force:navigateToObjectHome force:navigateToObjectHome force:navigateToObjectHome
Methods for Application-Level Custom Console Components
Lightning Console JavaScript API Method (Lightning Experience) Salesforce Console Integration Toolkit
(Salesforce Classic)
blinkCustomConsoleComponentButtonText()
isCustomConsoleComponentWindowHidden()
setCustomConsoleComponentButtonIconUrl()
setCustomConsoleComponentButtonStyle()
setCustomConsoleComponentButtonText() setCustomConsoleComponentHeight()
setCustomConsoleComponentVisible()
setCustomConsoleComponentWidth()
setCustomConsoleComponentWindowVisible()
Not supported.
Workaround: Use setUtilityLabel()
.
5
Preuzimanje
Oglas