Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

getDisplayLocation()

Retrieves the display location where the canvas app is being called from. For example, a value of Visualforce page.

Signature

public String getDisplayLocation()

Return Value

Type: String

The return value can be one of the following strings:
  • Chatter—The canvas app was called from the Chatter tab.
  • ChatterFeed—The canvas app was called from a Chatter canvas feed item.
  • MobileNav—The canvas app was called from the navigation menu.
  • OpenCTI—The canvas app was called from an Open CTI component.
  • PageLayout—The canvas app was called from an element within a page layout. If the displayLocation is PageLayout, one of the subLocation values might be returned.
  • Publisher—The canvas app was called from a canvas custom quick action.
  • ServiceDesk—The canvas app was called from a Salesforce Console component.
  • Visualforce—The canvas app was called from a Visualforce page.
  • None—The canvas app was called from the Canvas App Previewer.

Usage

Use this method to obtain the display location for the canvas app.