Newer Version Available

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

Environment

The Environment object is a JSON-formatted object containing context information about the canvas app environment. This object contains the Dimensions object, the Version object, and parameters (if there are any) in the Parameters object.

Field Description
displayLocation The location in the application where the canvas app is currently being called from. Valid values are:
  • Chatter—The canvas app was called from the Chatter tab.
  • ChatterFeed—The canvas app was called from a Chatter canvas feed item.
  • OpenCTI—The canvas app was called from an Open CTI component.
  • Publisher—The canvas app was called from a canvas custom publisher 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.
locationUrl The URL of the page in Salesforce where the user accesses the canvas app. For example, if users access your canvas app by clicking a link on the Chatter tab, this field contains the URL of the Chatter tab.
uiTheme The default theme for the context organization.

The following code snippet shows an example of the Environment object.

1"environment": 
2{ 
3    "parameters":{},
4    "dimensions":
5    { 
6        "height":"900px", 
7        "width":"800px",
8        "maxHeight":"2000px", 
9        "maxWidth":"1000px"
10 
11    }, 
12    "displayLocation":"Chatter", 
13    "locationUrl":"http://www.salesforce.com/some/path/index.html", 
14    "uiTheme":"Theme3",
15    "version":
16    { 
17        "api":"30.0", 
18        "season":"WINTER" 
19     }
20}