getLayout

This wire adapter gets layout information, metadata, and data to build UI for one or more records. Use it instead of the deprecated lightning/getRecordUi.

The getLayout wire adapter uses this User Interface API resource, but doesn’t support all its parameters.

Parameter NameTypeDescriptionRequired?
objectApiNameStringA supported object.Yes
layoutTypeStringLayout type for the record. A string that contains one of these values:
  • Compact—Use this value to get a layout that contains a record’s key fields.
  • Full—Use this value to get a full layout.
Yes
modeStringThe access mode for the record. This value determines which fields to get from a layout. Layouts have different fields for create, edit, and view modes. For example, formula fields are rendered in view mode, but not in create mode because they’re calculated at run time, like formulas in a spreadsheet. Each string contains one of these values:
  • Create—Use this mode if you intend to build UI that lets a user create a record.
  • Edit—Use this mode if you intend to build UI that lets a user edit a record.
  • View—Use this mode if you intend to build UI that displays a record.
Yes
recordTypeIdStringThe ID of the record type (RecordType object) for the new record. If not provided, the default record type is used.