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.
Action overrides are defined as part of a standard or custom object.
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.
- Type: string (enumeration of type string)
- Required: No
- Description: Required. The possible values are the same as the actions you can override:
- Possible values:
- accept
- clone
- delete
- edit
- list
- new
- tab
- view
- Type: string
- Required: No
- Description: Any comments you want associated with the override.
- Type: string
- Required: No
- Description: Set this field if
typeis set toflexipage,lightningcomponent,scontrol, orvisualforce. 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:Component_namespace__Component_name.
-
Type: FormFactor (enumeration of type string)
-
Required: No
-
Introduced: API version 37.0
-
Description: The size of the page being overridden.
If the
typefield is set toflexipage, set this field toLargeto override the View action with a Lightning page in Lightning Experience.The
Largevalue represents the Lightning Experience desktop environment and is valid only for theflexipageandlightningcomponenttypes. TheSmallvalue represents the Salesforce mobile app on a phone or tablet. TheMediumvalue is reserved for future use. Thenullvalue (which is the same as specifying no value) represents Salesforce Classic.This field is part of the feature for creating and editing record pages in Lightning Experience.
Lightning component overrides return different
FormFactorvalues depending on the API version used.- In API version 41.0 and earlier, Lightning component overrides return only the
nullvalue (no value), representing the Salesforce Classic environment. - 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
FormFactorvalue 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. - In API version 43.0 and later, a Lightning component override for Lightning Experience returns the
Largevalue and a Lightning component override for mobile returns theSmallvalue, as expected.
- In API version 41.0 and earlier, Lightning component overrides return only the
- Type: boolean
- Required: No
- Introduced: API version 21.0
- Description: Set this field to
trueif 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 theactionNameis a “create” type (likenew), andtypeis set tovisualforce.
- Type: ActionOverrideType (enumeration of type string)
- Required: No
- Description: Required. Represents the type of action override. Valid values are described in 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.
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.
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.
You can define action overrides, as in these examples for the Edit action.
A Visualforce page override for Salesforce Classic:
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:
A Lightning component override for the Salesforce mobile app:
When overrides are included in a managed package, the overrides are represented as default type in the metadata. Calling retrieve() presents the following:
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:
To set a Lightning page action override on the View standard button in Lightning Experience, use:
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.
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.