force:recordView

Generates a view of the specified Salesforce record.

A force:recordView component represents a read-only view of a record. You can display the record view using different layout types. By default, the record view uses the full layout to display all fields of the record. The mini layout displays fields corresponding to the compact layout. You can change the fields and the order they appear in the component by going to Compact Layouts in Setup for the particular object.

If you want granular control over displaying of specific fields, we recommend using lightning:outputField instead.

This example shows a record view with a mini layout.

<force:recordView recordId="a02D0000006V8Ov" type="MINI"/>

You can provide a dynamic ID for the recordId attribute using the format {!v.myObject.recordId}. To load record data, wire up the container component to an Apex controller that returns the data. See Working with Salesforce Records in the Lightning Components Developer Guide for more information.

To use this component in a standalone app, extend force:slds for the component to be styled correctly. Linking and hover overlays on lookup values are not supported in standalone apps.

Attributes

Attribute Name Attribute Type Description Required?
body Component[] The body of the component. In markup, this is everything in the body of the tag.
record SObjectRow The record (SObject) to load, optional if recordId attribute is specified.
recordId String The Id of the record to load, optional if record attribute is specified.
type String The type of layout to use to display the record. Possible values: FULL, MINI. The default is FULL.