---
schema_version: "1"
id: 92ed845d461b84ef6c4f9512dfc8e989c1845d12d9485ee9238f7e6ae301d46d
title: CompactLayout
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_compactlayout.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_compactlayout.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 73ca80c580577a7a961d70a377efea2302af815e238cb9a98f8d375f17db96b4
description: Represents the metadata associated with a compact layout. This type extends the Metadata metadata type and inherits its fullName field.
---
# CompactLayout

Represents the metadata associated with a compact layout. This type extends the Metadata metadata type and inherits its fullName field.

A compact layout displays a record’s key fields at a glance in the Salesforce mobile app, Lightning Experience, and in the Outlook and Gmail integrations.

Compact layouts support all field types except:

- text area
- long text area
- rich text area
- multi-select picklist

For more information on compact layouts, see [Compact Layouts](https://help.salesforce.com/s/articleView?id=platform.compact_layout_overview.htm&type=5&language=en_US "HTML (New Window)") in the Salesforce Help.

## File Suffix and Directory Location

Compact layouts are defined as part of the custom object, standard object, or external object definition. See [CustomObject](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customobject.htm "Represents a custom object that stores data unique to your org or an external object that maps to data stored outside your org.") for more information.

## Version

CompactLayout components are available in API version 29.0 and later. CompactLayout components are available for external objects in API version 42.0 and later.

## Fields

| Field Name | Field Type | Description |
| --- | --- | --- |
| fields | string | The fields assigned to the compact layout. Their order represents the prioritization given to them when defining the compact layout. |
| label | string | Label that represents the object throughout the Salesforce user interface. |

## Declarative Metadata Sample Definition

The following is an example of a CompactLayout component:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>Accept</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>Clone</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>Delete</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>Edit</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>List</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>New</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>Tab</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <actionOverrides\>
        <actionName\>View</actionName\>
        <type\>Default</type\>
    </actionOverrides\>
    <compactLayouts\>
        <fullName\>testCompactLayout</fullName\>
        <fields\>textfield\_\_c</fields\>
        <label\>testCompactLayoutLabel</label\>
    </compactLayouts\>
    <compactLayoutAssignment\>SYSTEM</compactLayoutAssignment\>
    <deploymentStatus\>Deployed</deploymentStatus\>
    <enableActivities\>false</enableActivities\>
    <enableFeeds\>false</enableFeeds\>
    <enableHistory\>false</enableHistory\>
    <enableReports\>false</enableReports\>
    <fields\>
        <fullName\>textfield\_\_c</fullName\>
        <externalId\>false</externalId\>
        <label\>textfield</label\>
        <length\>255</length\>
        <required\>false</required\>
        <type\>Text</type\>
        <unique\>false</unique\>
    </fields\>
    <label\>customObj</label\>
    <nameField\>
        <label\>customObj Name</label\>
        <type\>Text</type\>
    </nameField\>
    <pluralLabel\>customObjs</pluralLabel\>
    <recordTypes\>
        <fullName\>RT1</fullName\>
        <active\>true</active\>
        <label\>RT1</label\>
        <compactLayoutAssignment\>testCompactLayout</compactLayoutAssignment\>
    </recordTypes\>
    <recordTypes\>
        <fullName\>RT2</fullName\>
        <active\>true</active\>
        <label\>RT2</label\>
    </recordTypes\>
    <searchLayouts/\>
    <sharingModel\>ReadWrite</sharingModel\>
</CustomObject\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).

- [← Previous](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_businessprocess.htm "BusinessProcess")
- [Next →](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm "CustomField")