Get Object Layouts

AVAILABLE API VERSION
API v66.0 and later

The recordLayouts field of LayoutConnection type returns page layout metadata for objects. The response includes sections, rows, items, and polymorphic components, matching the User Interface REST API Record Layout.

Pass in recordLayouts in the uiapi field. For example, use objectApiName: ["Account"] to return the page layout metadata for the account object.

Query recordLayouts by using this schema.

The recordLayouts type has these arguments.

  • objectApiName - The object API name of a supported object. This argument is required.

  • recordTypeIds - A list of up to 10 record type IDs.

  • layoutConfigs - An array of layoutConfig types with these arguments to request different form factor and mode combinations per record type.

    • recordTypeId - A record type ID.
    • formFactor - Form factor that the FormFactor enum provides for the record type layout.
    • mode - Mode that the LayoutMode enum provides for the record type layout.
  • layoutType - Layout type that the LayoutType enum provides. Default value is FULL.

  • formFactor - Default form factor that the FormFactor enum provides for all layouts. Default value is LARGE.

  • mode - Default mode that the LayoutMode enum provides for all layouts. Default value is VIEW.

  • first - Number of layouts per page. Specify up to 10 layouts. Default value is 10.

  • after - Returns the results after the given cursor. See Paginate Results.

The LayoutConnection type represents a result set of record layouts that ties together the layouts and page info. Layouts are paginated by record type, with each edge representing one layout for one record type. See Paginate Results.

The LayoutConnection type contains these fields.

  • edges - A list of LayoutEdge types.
  • pageInfo - Information about the relative location in the result set.
  • totalCount - The number of records that are queried.

The LayoutEdge type ties together the record and its cursor.

The LayoutEdge type contains these fields.

  • node - One layout for one record type.
  • cursor - An opaque string used to page directly to this item in the result set.

The Layout type is the layout for the record type, matching the User Interface Record Layout representation.

The Layout type contains these fields.

  • id - ID of the layout.
  • layoutType - Layout type that the LayoutType enum provides.
  • mode - Mode that the LayoutMode enum provides.
  • objectApiName - API name of the object that the layout is associated with.
  • recordTypeId - Record type ID.
  • saveOptions - A list of save options for the layout.
  • sections - A list of layout sections.

The LayoutSaveOption type is the save option for a record layout. Save options define behavior that occurs when objects are created or modified using the given layout. For example, for Cases and Leads, a “UseDefaultAssignmentRule” save option is exposed to control whether assignment rules are applied when Cases or Leads are created or edited.

The LayoutSaveOption type contains these fields.

  • defaultValue - Indicates whether the save option defaults to enabled.
  • isDisplayed - Indicates whether the save option is displayed in the layout.
  • label - Label for the save option.
  • name - API name for the save option.
  • restHeaderName - REST API header for the save option.
  • soapHeaderName - SOAP API header for the save option.

The LayoutSection type is a section in a record layout.

The LayoutSection type contains these fields.

  • collapsible - Indicates whether the section can be collapsed.
  • columns - Number of columns in the section.
  • heading - Heading text for the section.
  • id - ID of the section.
  • layoutRows - List of rows in the section.
  • rows - Number of rows in the section.
  • tabOrder - Tab order that the TabOrder enum provides for the section.
  • useHeading - Indicates whether to display the heading text.

The LayoutRow type is a row in a record layout.

The LayoutRow type contains these fields.

  • layoutItems - A collection of items in the row, from left to right. Might not extend to the last column.

The LayoutItem type is an item in a record layout.

The LayoutItem type contains these fields.

  • editableForNew - Indicates whether the item can be edited when creating a record.
  • editableForUpdate - Indicates whether the item can be edited when updating a record.
  • label - Text label for the item.
  • layoutComponents - List of components that make up the item.
  • lookupIdApiName - ID field name of a lookup field.
  • required - Indicates whether the field is required in a layout when creating or updating a record. This information is useful if you want to render required fields with a different treatment, such as a red outline.
  • sortable - Indicates whether the item is sortable.
  • uiBehavior - UI behavior that the UiBehavior enum provides for the page and mini layout item. For other types of layouts, such as compact or quick action, the field is null. The value doesn’t reflect user-level or profile-level access.

The LayoutComponent interface is polymorphic with six concrete implementations. The componentType field for each concrete implementation indicates the type.

The LayoutComponent interface contains these fields.

  • apiName - API name of the component.
  • componentType - Layout component type that the LayoutComponentType enum provides.

The CanvasLayoutComponent is a canvas component on a record layout.

The CanvasLayoutComponent type contains these fields.

  • apiName - API name of the canvas app.
  • componentType - Value is CANVAS.
  • displayLocation - Location in the application that is calling the canvas app.
  • height - Height of the component.
  • referenceId - Unique ID of the canvas app definition.
  • showScroll - Indicates whether to show the scroll bar on the canvas component.
  • width - Width of the component.

The CustomLinkLayoutComponent is a custom link component on a record layout.

The CustomLinkLayoutComponent type contains these fields.

  • apiName - If a field powers this component, the API name of the field.
  • componentType - Value is CUSTOM_LINK.
  • behavior - Link behavior that the WeblinkWindowType enum provides.
  • customLinkUrl - Custom link URL.
  • label - Custom link label.

The EmptySpaceLayoutComponent is an empty placeholder space.

The EmptySpaceLayoutComponent type contains these fields.

  • apiName - If the component is powered by a field, the API name of the field.
  • componentType - Value is EMPTY_SPACE.

The FieldLayoutComponent is a standard field on a record layout.

The FieldLayoutComponent type contains these fields.

  • apiName - API name of the field.
  • componentType - Value is FIELD.
  • label - Label of the field.

The ReportLayoutComponent is an embedded report chart component on a record layout.

The ReportLayoutComponent type contains these fields.

  • apiName - If a field powers this component, the API name of the field.
  • componentType - Value is REPORT_CHART.
  • cacheData - Indicates whether to cache data.
  • error - Error message.
  • filter - Filter for the report.
  • hideOnError - Indicates whether to hide the component if there’s an error.
  • placeholder - Placeholder for the report.
  • reportId - Component’s report ID.
  • showTitle - Indicates whether to show the report’s title.
  • size - Size of the component.

The VisualforceLayoutComponent is an embedded Visualforce component on a record layout.

The VisualforceLayoutComponent type contains these fields.

  • apiName - If a field powers this component, the API name of the field.
  • componentType - Value is VISUALFORCE_PAGE.
  • height - Height of the component.
  • showLabel - Indicates whether to show the section label with the component.
  • showScroll - Indicates whether to show the scroll bar on the component.
  • visualforceUrl - Visualforce URL.
  • width - Width of the component.

The PageInfo type contains relative position information, which shows where in the entire result set the current page is located. The PageInfo type is the same for every Connection type. See PageInfo Type.

The recordLayouts type has these enumerations.

The FormFactor enumeration specifies the layout display size for the record. The LARGE value is for desktop, the MEDIUM value is for tablet, and the SMALL value is for phone.

The LayoutComponementType enumeration indicates the layout component type.

The LayoutMode enumeration specifies the access mode for the record. The 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.

The LayoutType enumeration specifies the layout type for the record. The COMPACT value indicates a layout that contains a record's key fields only.

The TabOrder enumeration specifies the tab order for the items in a section.

The UiBehavior enumeration indicates the layout item behavior on page and mini layouts. The value doesn’t reflect user-level or profile-level access.

The WeblinkWindowType enumeration indicates how a link behaves on open.

Get Record Layout Examples