Newer Version Available

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

QuickAction

Represents a specified create or update quick action for an object that then becomes available in the Chatter publisher. For example, you can create an action that, on the detail page of an account, allows a user to create a contact related to that account from the Chatter feed on that page. QuickAction can be created on objects that allow custom fields. The parent objects supported include:
  • Account
  • Campaign
  • Case
  • Contact
  • ContentNote
  • Custom objects
  • Group
  • Lead
  • Opportunity

File Suffix and Directory Location

QuickAction components have the suffix quickAction and are stored in the quickActions folder.

Version

QuickAction components are available in API version 28.0 and later.

Fields

Field Name Field Type Description
canvas string If the custom action invokes a Canvas app, the app name. Returns the fully qualified name of the Canvas app in the format <namespace>__<dev_name>, if the quick action type is Canvas; otherwise, returns null.

This field is available in API version 29.0 and later.

description string The description of the action.
fieldOverrides FieldOverride[] The specific field that may be overridden within a QuickAction.
flowDefinition string If the custom action invokes a flow, this field represents the unique name of the flow. Otherwise, this field is null.

Available as a Beta in API version 41.0 and later.

height int If a custom action is created, this field represents the height in pixels of the action pane.
icon string The icon used to identify the action.

API version 32.0 and later returns different icons than in earlier API versions.

isProtected boolean Indicates whether this component is protected (true) or not (false). Protected components cannot be linked to or referenced by components created in the installing organization.
label string Identifies the action and displays to users. This is also the default identifier used for the API and managed packages.
lightningComponent string If the custom action invokes a Lightning component, this field represents the fully qualified name of the component. Otherwise, this field is null.

Available in API version 38.0 and later.

optionsCreateFeedItem boolean Required. Indicates whether successful completion of the action creates a feed item (true) or not (false). Applies only to Create Record, Update Record, and Log a Call quick action types.

Available in API version 36.0 and later.

page string If the custom action invokes a Visualforce page, this field identifies the page.
quickActionLayout QuickActionLayout The layout of fields on the action.
standardLabel QuickActionLabel (enumeration of type string) Specifies the standard label to use for the action. The valid values are:
  • AddRecord
  • AddMember
  • ChangeDueDate
  • ChangePriority
  • ChangeStatus
  • CreateNew
  • CreateNewRecordType (For example, a label with something like “Create New Idea”)
  • Defer
  • EditDescription
  • Escalate
  • EscalateToRecord
  • Forward
  • LogACall
  • LogANote
  • New (A new record)
  • NewChild (A new child record)
  • NewChildRecordType
  • NewRecordType (For example, a label with something like “New Idea”)
  • OfferFeedback
  • Quick (A quick record)
  • QuickRecordType
  • Reply
  • ReplyAll
  • RequestFeedback
  • SendEmail (This value is available in API version 31.0 and later.)
  • Update
successMessage string The message that displays to the user upon successful completion of the action.

Available in API version 36.0 and later.

targetObject string The object for which the action is created and performed.

For example, you can create an action that, on the detail page of an account, allows a user to create a contact related to that account from the Chatter feed on that page. In this case, Contact is the targetObject.

targetParentField string The parent object type of the action. Links the target object to the parent object. For example, use Account if the target object is Contact and the parent object is Account.
targetRecordType string Specifies which record type to create. Valid values are:
  • Business Account
  • Person Account
  • Master
type QuickActionType (enumeration of type string) Required. The type of quick action. Valid values are:
  • Canvas
  • Create
  • Flow (This value is available as a Beta in API version 41.0 and later)
  • LightningComponent (This value is available in API version 38.0 and later.)
  • LogACall
  • Post
  • SendEmail (This value is available in API version 31.0 and later.)
  • SocialPost
  • Update
  • VisualforcePage
width int If a custom action is created, this field represents the width in pixels of the action pane.

FieldOverride

Represents the field names and their respective formulas and literal values that comprise predefined value settings for a QuickAction. If a field on an action has both a predefined value and a default value set, the action uses the predefined value, not the default value. A formula value takes precedence over a literal value if both are defined.

Field Name Field Type Description
field string Required. The name of the field to allow predefined values on.
formula string Specifies the formula to use when setting a field’s predefined value. Supported for single-select picklists as of API version 43.0.
literalValue string Supported for picklists only. Specifies the literal value of the field defined from values in the picklist. Corresponds to the Specific Value field in the predefined value UI.

QuickActionLayout

The layout of fields on the action. There is no hard limit to the number of fields you can add to an action layout. However, for optimum usability, we recommend a maximum of eight fields. Adding more than 20 fields can severely affect user efficiency.

Field Name Field Type Description
layoutSectionStyle LayoutSectionStyle (enumeration of type string) Required. The type of layout structure used. The valid values are:
  • TwoColumnsTopToBottom
  • TwoColumnsLeftToRight
  • OneColumn
  • CustomLinks
quickActionLayoutColumns QuickActionLayoutColumn[] Specifies columns in a QuickActionLayout.

QuickActionLayoutColumn

A column defined for a QuickActionLayout.

Field Name Field Type Description
quickActionLayoutItems QuickActionLayoutItem [] Specifies row items in a QuickActionLayoutColumn.

QuickActionLayoutItem

A row item comprised of fields and defined for a QuickActionLayoutColumn.

Field Name Field Type Description
emptySpace boolean Controls if this layout item is a blank space (true) or not (false).
field string Represents a specific field in QuickActionLayoutItem. There is no hard limit to the number of fields you can add to an action layout. However, for optimum usability, we recommend a maximum of eight fields. Adding more than 20 fields can severely affect user efficiency.
uiBehavior UiBehavior (enumeration of type string) Specifies user input behavior for specific fields in QuickActionLayoutItem. The valid values are:
  • Edit
  • Required
  • Readonly

Declarative Metadata Sample Definition

The following is an example of a QuickAction component:

1<?xml version="1.0" encoding="UTF-8"?>
2<QuickAction xmlns="http://soap.sforce.com/2006/04/metadata">
3    <description>testActionDefinitionTypesCreateTask</description>
4    <label>testActionDefinitionTypesCreateTask</label>
5    <optionsCreateFeedItem>true</optionsCreateFeedItem>
6    <quickActionLayout>
7        <layoutSectionStyle>TwoColumnsLeftToRight</layoutSectionStyle>
8        <quickActionLayoutColumns>
9            <quickActionLayoutItems>
10                <emptySpace>false</emptySpace>
11                <field>OwnerId</field>
12                <uiBehavior>Required</uiBehavior>
13            </quickActionLayoutItems>
14            <quickActionLayoutItems>
15                <emptySpace>false</emptySpace>
16                <field>WhoId</field>
17                <uiBehavior>Edit</uiBehavior>
18            </quickActionLayoutItems>
19            <quickActionLayoutItems>
20                <emptySpace>false</emptySpace>
21                <field>WhatId</field>
22                <uiBehavior>Edit</uiBehavior>
23            </quickActionLayoutItems>
24            <quickActionLayoutItems>
25                <emptySpace>false</emptySpace>
26                <field>ActivityDate</field>
27                <uiBehavior>Edit</uiBehavior>
28            </quickActionLayoutItems>
29            <quickActionLayoutItems>
30                <emptySpace>false</emptySpace>
31                <field>Subject</field>
32                <uiBehavior>Edit</uiBehavior>
33            </quickActionLayoutItems>
34            <quickActionLayoutItems>
35                <emptySpace>false</emptySpace>
36                <field>Status</field>
37                <uiBehavior>Required</uiBehavior>
38            </quickActionLayoutItems>
39            <quickActionLayoutItems>
40                <emptySpace>false</emptySpace>
41                <field>Priority</field>
42                <uiBehavior>Required</uiBehavior>
43            </quickActionLayoutItems>
44        </quickActionLayoutColumns>
45        <quickActionLayoutColumns/>
46    </quickActionLayout>
47    <successMessage>This is a success message</successMessage>
48    <targetObject>Task</targetObject>
49    <targetParentField>What</targetParentField>
50    <type>Create</type>
51</QuickAction>