Lightning Component Code Examples
Client
Application
Dimensions
Parameters
Version
Links
Organization
User
Controller
SignedRequest
Canvas Limits
Previous Versions
The Environment object is a JSON-formatted object containing context information about the canvas app environment. This object contains the Dimensions object, the Record 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:
|
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. |
subLocation | The sublocation in the application where the canvas app was called from when the canvas app is loaded in a mobile device. The subLocation is related to the displayLocation. Valid values for this field when the displayLocation is PageLayout are:
|
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 "clientHeight": "50px",
7 "clientWidth": "70px",
8 "height":"900px",
9 "width":"800px",
10 "maxHeight":"2000px",
11 "maxWidth":"1000px"
12
13 },
14 "record": {
15 "attributes": {
16 "type": "Account",
17 "url": "/services/data/v68.0/sobjects/Account/001xx000003DGWiAAO"
18 },
19 "Id": "001xx000003DGWiAAO",
20 "Phone": "(555) 555-5555",
21 "Fax": "(555) 555-5555",
22 "BillingCity": "Seattle"
23 },
24 "displayLocation":"PageLayout",
25 "locationUrl":"https://salesforce.com/some/path/index.html",
26 "subLocation":"S1MobileCardFullview",
27 "uiTheme":"Theme3",
28 "version":
29 {
30 "api":"68.0",
31 "season":"SUMMER"
32 }
33}See Also