---
schema_version: "1"
id: 46c0bd329026da6d763e165abee8d3e27ec08b778f0b66a2a134a9d07825bd83
title: ActionOverride
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/actionoverride.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/actionoverride.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d26a82c937889120a3970f5a8fb3af6240e97bf1bb848acb7e24cb83211b8f9d
description: Represents an action override on a standard or custom object. Use it to create, update, edit, or delete action overrides. You can access ActionOverride only by accessing its encompassing CustomObject.
---
# ActionOverride

Represents an action override on a standard or custom object. Use it to create, update, edit, or delete action overrides. You can access ActionOverride only by accessing its encompassing CustomObject.

## Declarative Metadata File Suffix and Directory Location

Action overrides are defined as part of a standard or custom object.

## Version

Action overrides are available in API version 18.0 and later. As of Summer ’13, action overrides can be applied to both standard and custom objects. Previously, action overrides only applied to custom objects.

## Fields

Unless otherwise noted, all fields are creatable, filterable, and nillable.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d49301e82">Field Name</th>

              <th class="featureTableHeader  " id="d49301e85">Field Type</th>

              <th class="featureTableHeader  " id="d49301e88">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname">actionName</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">string</td>

              <td class="entry" headers="d49301e88" data-title="Description">Required. The
                possible values are the same as the actions you can override:<a name="actionName_values"><!-- --></a>
                <ul class="ul bulletList" id="actionName_values">
                  <li class="li"><samp class="codeph nolang">accept</samp></li>

                  <li class="li"><samp class="codeph nolang">clone</samp></li>

                  <li class="li"><samp class="codeph nolang">delete</samp></li>

                  <li class="li"><samp class="codeph nolang">edit</samp></li>

                  <li class="li"><samp class="codeph nolang">list</samp></li>

                  <li class="li"><samp class="codeph nolang">new</samp></li>

                  <li class="li"><samp class="codeph nolang">tab</samp></li>

                  <li class="li"><samp class="codeph nolang">view</samp></li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname">comment</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">string</td>

              <td class="entry" headers="d49301e88" data-title="Description">Any comments you want
                associated with the override.</td>

            </tr>

            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname">content</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">string</td>

              <td class="entry" headers="d49301e88" data-title="Description"><span class="ph" id="content_field_desc"><a name="content_field_desc"><!-- --></a>Set this field if
                  <span class="keyword parmname">type</span> is set to <samp class="codeph nolang">flexipage</samp>, <samp class="codeph nolang">lightningcomponent</samp>, <samp class="codeph nolang">scontrol</samp>, or <samp class="codeph nolang">visualforce</samp>. It refers to the
                  name of the Lightning page, Lightning component, s-control, or
                  Visualforce page to use as the override. To reference installed
                  components, use this format: <samp class="codeph nolang"><var class="keyword varname">Component_namespace</var>__<var class="keyword varname">Component_name</var></samp>.</span></td>

            </tr>

            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname" id="actionoverride_formfactor"><a name="actionoverride_formfactor"><!-- --></a>formFactor</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">FormFactor (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d49301e88" data-title="Description">
                <span class="ph" id="meta_actionOverride_formFactor_desc"><a name="meta_actionOverride_formFactor_desc"><!-- --></a>The size of the page
                  being overridden.</span>
                <p class="p">If the <span class="keyword parmname">type</span> field
                  is set to <samp class="codeph nolang">flexipage</samp>, set
                  this field to <samp class="codeph nolang">Large</samp> to
                  override the View action with a Lightning page in Lightning
                  Experience.</p>

                <p class="p" id="formfactor_value_desc"><a name="formfactor_value_desc"><!-- --></a>The <samp class="codeph nolang">Large</samp> value represents the
                  Lightning Experience desktop environment and is valid only for
                  the <samp class="codeph nolang">flexipage</samp> and <samp class="codeph nolang">lightningcomponent</samp> types. The
                  <samp class="codeph nolang">Small</samp> value represents
                  the Salesforce mobile app on a phone or tablet. The <samp class="codeph nolang">Medium</samp> value is reserved for
                  future use. The <samp class="codeph nolang">null</samp> value
                  (which is the same as specifying no value) represents Salesforce
                  Classic.
                </p>

                <p class="p">This field is available in API version 37.0 and
                  later and is part of the feature for creating and editing record
                  pages in Lightning Experience.</p>
                Lightning component overrides
                return different <span class="keyword parmname">FormFactor</span> values depending on
                the API version used. <ul class="ul bulletList">
                  <li class="li">In API version 41.0 and earlier, Lightning component
                    overrides return only the <samp class="codeph nolang">null</samp> value (no value), representing the
                    Salesforce Classic environment.</li>

                  <li class="li">In API version 42.0, if you specify different Lightning
                    component overrides for Lightning Experience and mobile, one
                    component is selected randomly for both overrides and its
                    <span class="keyword parmname">FormFactor</span> value is returned. If
                    there’s a conflict between Lightning components, and a
                    Visualforce page override is also specified for Salesforce
                    Classic, the Visualforce page takes precedence.
                  </li>

                  <li class="li">In API version 43.0 and later, a Lightning component
                    override for Lightning Experience returns the <samp class="codeph nolang">Large</samp> value and a Lightning
                    component override for mobile returns the <samp class="codeph nolang">Small</samp> value, as
                    expected.</li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname">skipRecordTypeSelect</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">boolean</td>

              <td class="entry" headers="d49301e88" data-title="Description">
                <span class="ph" id="meta_actionOverride_skipRecordTypeSelect_desc"><a name="meta_actionOverride_skipRecordTypeSelect_desc"><!-- --></a>Set this
                  field to <samp class="codeph nolang">true</samp> if you prefer
                  that any new records created by this action override aren’t
                  forwarded to the record type selection page. This field is only
                  valid if the <span class="keyword parmname">actionName</span> is a “create” type
                  (like <samp class="codeph nolang">new</samp>), and
                  <span class="keyword parmname">type</span> is set to <samp class="codeph nolang">visualforce</samp>.</span> This field is
                available in API version 21.0 and later.
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d49301e82" data-title="Field Name"><span class="keyword parmname">type</span></td>

              <td class="entry" headers="d49301e85" data-title="Field Type">ActionOverrideType (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d49301e88" data-title="Description">Required. Represents the
                type of action override. Valid values are described in <a class="xref" href="#actionOverrideType_section">ActionOverrideType</a>.</td>

            </tr>

          </tbody>

        </table>

## ActionOverrideType

[ActionOverrideType](#actionOverrideType_section) is an enumeration of type string that defines which kind of action override to use. The valid values are:

- default—The override uses a custom override provided by an installed package. If there isn’t one available, the standard Salesforce behavior is used.
- flexipage—The override uses behavior from a Lightning page, and is only valid for the View action in Lightning Experience.
- lightningcomponent—The override uses behavior from a Lightning component.
- scontrol—The override uses behavior from an s-control.
- standard—The override uses regular Salesforce behavior.
- visualforce—The override uses behavior from a Visualforce page.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

Existing s-controls can be used as overrides for Salesforce Classic under certain conditions. However, s-controls have been deprecated since the Spring ’09 release. We recommend using Visualforce pages instead.

## Usage

You can't delete ActionOverrides by deploying with destructiveChange.xml. To delete an ActionOverride, retrieve the CustomObject. In the definition file, find the <ActionOverrides> section, and remove the <content> row. Then, change the <type> value in that same section to Default. Do this for every override you want to reset. After making the changes, rezip the folder and deploy.

You can remove one override at a time each with its own deploy, or you can remove multiple overrides in a single deploy. However, we recommend that you do a fresh retrieve every time you want to delete a new override. Don’t use a previously retrieved file.

Org default flexipage override assignment metadata can’t be retrieved from a managed package.

## Declarative Metadata Sample Definitions

You can define action overrides, as in these examples for the Edit action.

A Visualforce page override for Salesforce Classic:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>edit</actionName\>
        <type\>visualforce</type\>
        <content\>myEditVFPage</content\>
        <comment\>This edit action is a lot safer.</comment\>
     </actionOverrides\>
</CustomObject

This example includes no value for FormFactor. Using no value is the same as using the null value, which represents Salesforce Classic.

A Lightning component override for Lightning Experience:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>edit</actionName\>
        <type\>lightningcomponent</type\>
        <content\>myEditLightningComponent</content\>
        <formFactor\>Large</formFactor\>
        <comment\>This edit action is a lot safer.</comment\>
     </actionOverrides\>
</CustomObject\>

A Lightning component override for the Salesforce mobile app:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>edit</actionName\>
        <type\>lightningcomponent</type\>
        <content\>myEditLightningComponent</content\>
        <formFactor\>Small</formFactor\>
        <comment\>This edit action is a lot safer.</comment\>
     </actionOverrides\>
</CustomObject\>

When overrides are included in a managed package, the overrides are represented as default type in the metadata. Calling [retrieve()](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_retrieve.htm#meta_retrieve "The retrieve() call retrieves XML file representations of components in an organization.") presents the following:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>edit</actionName\>
        <type\>default</type\>
     </actionOverrides\>
</CustomObject\>

If you subscribe to a managed package with default overrides, you can replace the default override behavior by editing the XML. For example, to replace the Visualforce page override with the Salesforce standard page for Salesforce Classic, use:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>edit</actionName\>
        <type\>standard</type\>
     </actionOverrides\>
</CustomObject\>

To set a Lightning page action override on the View standard button in Lightning Experience, use:

<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionOverrides\>
        <actionName\>View</actionName\>
        <content\>myLightningPage</content\>
        <formFactor\>Large</formFactor\>
        <type\>flexipage</type\>
    </actionOverrides\>
</CustomObject\>

## Wildcard Support in the Manifest File

This metadata type doesn’t support 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).

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

#### See Also

- [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.")