skuid.lightning

skuid.lightning.workspaceAPI

A representation of the Salesforce Lightning Workspace API of the current Lightning page. Only available to Skuid snippets and inline JavaScript when running Skuid within Lightning.

As this is an access point for the Lightning Workspace API, see Salesforce’s Workspace API documentation for a list of available methods.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
// Creating a reference to the Workspace API
var api = skuid.lightning.workspaceAPI;

// Accessing the workspace API to retrieve
// information on currently open workspace tabs,
// then using the returned array to close the first tab.
// This is done using two Workspace API methods,
// getAllTabInfo() and closeTab(). For more information,
// see the linked Salesforce docs above.
return api.getAllTabInfo().then(tabInfo => {
  return api.closeTab({
    tabId: tabInfo[0].tabId
  });
});