Newer Version Available

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

Record

The Record object is a JSON-formatted object that contains information about the object on which the canvas app appears. This could be a standard object like Account or a custom object like Warehouse__c. If the canvas app doesn’t appear on an object page or in the publisher or feed associated with an object, then the Record object is empty.

This object contains the Attributes object.

Field Description
Id The ID of the related object. For example, if the canvas app appears on an Account page, this field contains the AccountId.

If the canvas app appears on a Visualforce page through use of the <apex:canvasApp> component, and that Visualforce page is associated with an object (placed on the page layout, for example), you can use the entityFields attribute on the component to return specific fields or all fields from the related object.

The following code snippet shows an example of the Record object returned from a canvas app that appears on an Account page. In this example, the Phone, Fax, and BillingCity fields were specified in the entityFields attribute.

1"record":{
2    "attributes":{
3        "type":"Account",
4        "url":"/services/data/v45.0/sobjects/Account/001xx000003DGWiAAO"
5    },
6        "Id":"001xx000003DGWiAAO",
7        "Phone":"(555) 555-5555",
8        "Fax":"(555) 555-5555",
9        "BillingCity":"Seattle"
10    }