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.

  • objectApiName—(Required) A supported object.
  • layoutType—(Required) Layout 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.
  • mode—(Required) The 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.
  • A string or an array of strings. 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.
  • recordTypeId—(Optional) The ID of the record type (RecordType object) for the new record. If not provided, the default record type is used.