Newer Version Available

This content describes an older version of this product. View Latest

ActionOverride

Represents an action override on a standard or custom object. Use it to create, update, edit, or delete action overrides. You can only access ActionOverride 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. Beginning in Summer ’13, action overrides can be applied to both standard or custom objects. Previously, action overrides only applied to custom objects.

Fields

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

Field Name Field Type Description
actionName string Required. The possible values are the same as the actions you can override:
  • accept
  • clone
  • delete
  • edit
  • list
  • new
  • tab
  • view
comment string Any comments you want associated with the override.
content string Set this field if type is set to flexipage, lightningcomponent, scontrol, or visualforce. 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 the format of Component_namespace__Component_name.
formFactor FormFactor (enumeration of type string) The size of the page being overridden. Only the Large value is supported. The other values, Small and Medium, are reserved for future use.

If the type field is set to flexipage, set this field to Large to override the View action with a Lightning page in Lightning Experience.

The Large value represents the Lightning Experience desktop environment, and is only valid for the flexipage type. For other types, this field defaults to null.

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.

skipRecordTypeSelect boolean Set this field to true 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 actionName is a “create” type (like new), and type is set to visualforce. This field is available in API version 21.0 and later.
type ActionOverrideType (enumeration of type string) Required. Represents the type of action override. Valid values are described in ActionOverrideType.

ActionOverrideType

ActionOverrideType 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.

Declarative Metadata Sample Definitions

You can define an action like this:
1<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
2    <actionOverrides>
3        <actionName>edit</actionName>
4        <type>visualforce</type>
5        <content>myEditVFPage</content>
6        <comment>This edit action is a lot safer.</comment>
7     </actionOverrides>
8</CustomObject>
With the previous definition, calling retrieve() presents:
1<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
2    <actionOverrides>
3        <actionName>edit</actionName>
4        <type>default</type>
5     </actionOverrides>
6</CustomObject>
If a subscriber installed a package with the previous metadata, you can override the behavior by editing the XML. For example, if you want the regular Salesforce behavior, use:
1<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
2    <actionOverrides>
3        <actionName>edit</actionName>
4        <type>standard</type>
5     </actionOverrides>
6</CustomObject>
To set a Lightning page action override on the View standard button in Lightning Experience, use:
1<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
2    <actionOverrides>
3        <actionName>View</actionName>
4        <content>myLightningPage</content>
5        <formFactor>Large</formFactor>
6        <type>flexipage</type>
7    </actionOverrides>
8</CustomObject>