QuickActionDefinition

Represents the definition of a quick action.

Version 

Introduced in API version 32.0.

Supported SOAP API Calls 

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

Supported REST API Methods 

DELETE, GET, HEAD, PATCH, POST, Query

Fields 

ActionSubtype 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Introduced: API version 50.0

  • Description: The subtype of the action.

This field is available only for Lightning web component quick actions.

  • Possible values:

    • ScreenAction — Screen Action — This value is available only for actions of type LightningWebComponent.

    • Action — Action — This value is available only for actions of type LightningWebComponent.

    • Create — Create Related Record — This value is available only for actions of type Flexipage. (This value is available as a Beta in API version 68.0 and later)

    • Update — Update Current Record — This value is available only for actions of type Flexipage. (This value is available as a Beta in API version 68.0 and later)

Description 

  • Type: textarea

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The description of the action.

DeveloperName 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: The unique name of the action in the API. This field corresponds to the Name field in the user interface.

Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.

EntityDefinitionId 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Introduced: API version 34.0

  • Description: The ID of the object associated with the quick action.

FullName 

  • Type: string

  • Required: No

  • Properties: Create, Group, Nillable

  • Introduced: API version 39.0

  • Description: The full name of the associated metadata object in Metadata API.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

Height 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The height of the action, in pixels. This field is set only when the quick action has a custom icon.

IconId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The ID of the action icon. This field is set only when the quick action has a custom icon.

  • Relationship name: Icon

  • Relationship type: relationship

  • Refers to: StaticResource

Label 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The action label that corresponds to the Label field in the user interface.

Language 

  • Type: picklist

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort

  • Description: The language of the action. Valid values are:

  • Chinese (Simplified): zh_CN

  • Chinese (Traditional): zh_TW

  • Danish: da

  • Dutch: nl_NL

  • English: en_US

  • Finnish: fi

  • French: fr

  • German: de

  • Italian: it

  • Japanese: ja

  • Korean: ko

  • Norwegian: no

  • Portuguese (Brazil): pt_BR

  • Russian: ru

  • Spanish: es

  • Spanish (Mexico): es_MX Spanish (Mexico) defaults to Spanish for customer-defined translations.

  • Swedish: sv

  • Thai: th The Salesforce user interface is fully translated to Thai, but Help is in English.

  • Possible values:

    • en_US — English

    • de — German

    • es — Spanish

    • fr — French

    • it — Italian

    • ja — Japanese

    • sv — Swedish

    • ko — Korean

    • zh_TW — Chinese (Traditional)

    • zh_CN — Chinese (Simplified)

    • pt_BR — Portuguese (Brazil)

    • nl_NL — Dutch

    • da — Danish

    • th — Thai

    • fi — Finnish

    • ru — Russian

    • es_MX — Spanish (Mexico)

    • no — Norwegian

ManageableState 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Description: Indicates the manageable state of the specified component that is contained in a package:

  • beta

  • deleted

  • deprecated

  • deprecatedEditable

  • installed

  • installedEditable

  • released

  • unmanaged

This field is available in API version 38.0 and later.

  • Possible values:

    • beta — beta

    • deleted — deleted

    • deprecated — deprecated

    • deprecatedEditable — deprecatedEditable

    • installed — installed

    • installedEditable — installedEditable

    • released — released

    • unmanaged — unmanaged

MasterLabel 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: The action label.

Metadata 

  • Type: complexvalue

  • Required: No

  • Properties: Create, Nillable, Update

  • Introduced: API version 39.0

  • Description: The metadata for the quick action.

Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

ModalSize 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Introduced: API version 68.0

  • Possible values:

    • Small — Small

    • Medium — Medium

    • Large — Large

NamespacePrefix 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The namespace of the action.

OptionsCreateFeedItem 

  • Type: boolean

  • Required: No

  • Properties: Filter

  • Introduced: API version 36.0

  • Description: 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.

SobjectType 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Restricted picklist, Sort

  • Description: The associated object’s API name. For example, FeedItem.

StandardLabel 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Introduced: API version 29.0

  • Description: The standard label for the action.

  • Possible values:

    • LogACall — Log a Call

    • LogANote — Log A Note

    • New — New [Record]

    • NewRecordType — New [Record Type]

    • Update — Update [Record]

    • NewChild — New Child [Record]

    • NewChildRecordType — New Child [Record Type]

    • CreateNew — Create New [Record]

    • CreateNewRecordType — Create New [Record Type]

    • SendEmail — Email

    • QuickRecordType — Quick [Record Type]

    • Quick — Quick [Record]

    • EditDescription — Edit Comments

    • Defer — Change Date

    • ChangeDueDate — Change Due Date

    • ChangePriority — Change Priority

    • ChangeStatus — Change Status

    • SocialPost — Social Post

    • Escalate — Escalate

    • EscalateToRecord — Escalate to [Record]

    • OfferFeedback — Offer Feedback

    • RequestFeedback — Request Feedback

    • AddRecord — Add Record

    • AddMember — Add Member

    • Reply — Reply

    • ReplyAll — Reply All

    • Forward — Forward

    • ScheduleAppointment — Schedule Appointment

    • EnrollInProgram — Enroll in Program

    • ModifyAppointment — Modify Service Appointment

    • PatientDetails — Patient Details

    • AcceptBroadcast — Accept Visit

    • SelectCoverage — Select Coverage

    • AssetHierarchy — Asset Hierarchy

    • PartReturnRequest — New Service Part Return

    • PerformCount — Perform Count

    • ViewCoverage — View Coverage

    • Quip — New Document

    • SendConversationMessage — Send A Message

    • NewQuote — New Quote

    • LaunchDataCapture — Start

    • RelocateAsset — Relocate Asset

    • ReplaceAsset — Replace Asset

    • OfflineAssessment — Add Employee

    • CloseCase — Close Case

SuccessMessage 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Introduced: API version 36.0

  • Description: The message that displays to the user upon successful completion of the action.

TargetField 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Description: The API name of the parent object for the record created by this quick action. For example, CollaborationGroup.

TargetRecordTypeId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The ID of the target record type.

  • Relationship name: TargetRecordType

  • Relationship type: relationship

  • Refers to: RecordType

TargetSobjectType 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Description: The API name of the type of object record this action creates. For example, OpportunityLineItem.

Type 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Restricted picklist, Sort

  • Description: The type of action.

  • Possible values:

    • Create — Create a Record

    • VisualforcePage — Custom Visualforce

    • Post — Post

    • SendEmail — Send Email

    • LogACall — Log a Call

    • SocialPost — Social Post

    • Canvas — Custom Canvas

    • Update — Update a Record

    • LightningComponent — Lightning Component

    • LightningWebComponent — Lightning Web Component

    • Flow — Flow

    • MobileExtension — Field Service Mobile Extension

    • Quip — Quip

    • SendConversationMessage — Send Message

    • Flexipage — Lightning Page (Beta)

Width 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: The width of the action, in pixels. This field is set only when the quick action has a custom icon.

Usage 

A QuickActionDefinition represents information about a quick action. The following example creates a global quick action that lets users quickly create a task.

1QuickActionDefinition qad = new QuickActionDefinition();
2qad.setDeveloperName("MyQuickCreateTaskAction");
3qad.setSobjectType("Global");
4qad.setTargetSobjectType("Task");
5qad.setMasterLabel("Quick create a task");
6qad.setType(QuickActionType.Create);
7qad.setDescription("Quickly creates a Task");
8
9sforce.create(new SObject[]{qad});

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!