force:recordPreview

The force:recordPreview tag lets you define the parameters for accessing, modifying, or creating a record using Lightning Data Service.

Attributes

Attribute Name Attribute Type Description Required?
fields String[] List of fields to query.

This attribute or layoutType must be specified. If you specify both, the list of fields queried is the union of fields from fields and layoutType.

ignoreExistingAction Boolean Whether to skip the cache and force a server request. Defaults to false.

Setting this attribute to true is useful for handling user-triggered actions such as pull-to-refresh.

layoutType String Name of the layout to query, which determines the fields included. Valid values are the following.
  • FULL
  • COMPACT

This attribute or fields must be specified. If you specify both, the list of fields queried is the union of fields from fields and layoutType.

mode String The mode in which to access the record. Valid values are the following.
  • VIEW
  • EDIT
Defaults to VIEW.
recordId String The 15-character or 18-character ID of the record to load, modify, or delete. Defaults to null, to create a record.
targetError String A reference to a component attribute, to which a localized error message is assigned if there’s an error performing the requested action.
targetRecord Record A reference to a component attribute, to which the loaded record is assigned.

Changes to the record are also assigned to this value, which triggers change handlers, re-renders, and so on.