Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

QuickActionRequest Class

Use the QuickAction.QuickActionRequest class for providing action information for quick actions to be performed by QuickAction class methods. Action information includes the action name, context record ID, and record.

Namespace

QuickAction

Usage

For Apex saved using Salesforce API version 28.0, a parent ID is associated with the QuickActionRequest instead of the context ID.

The constructor of this class takes no arguments:

Example

In this sample, a new quick action is created to create a contact and assign a record to it.

QuickActionRequest Constructors

The following are constructors for QuickActionRequest.

QuickActionRequest()

Creates a new instance of the QuickAction.QuickActionRequest class.

Signature

public QuickActionRequest()

QuickActionRequest Methods

The following are methods for QuickActionRequest. All are instance methods.

getContextId()

Returns this QuickAction’s context record ID.

Signature

public Id getContextId()

Return Value

Type: ID

getQuickActionName()

Returns this QuickAction’s name.

Signature

public String getQuickActionName()

Return Value

Type: String

getRecord()

Returns the QuickAction’s associated record.

Signature

public SObject getRecord()

Return Value

Type: sObject

setContextId(contextId)

Sets this QuickAction’s context ID. Returned by getContextId.

Signature

public Void setContextId(Id contextId)

Parameters

  • contextId:

    Type: ID

Return Value

Type: Void

Usage

For Apex saved using Salesforce API version 28.0, sets this QuickAction’s parent ID and is returned by getParentId.

setQuickActionName(name)

Sets this QuickAction’s name. Returned by getQuickActionName.

Signature

public Void setQuickActionName(String name)

Parameters

Return Value

Type: Void

setRecord(record)

Sets a record for this QuickAction. Returned by getRecord.

Signature

public Void setRecord(SObject record)

Parameters

Return Value

Type: Void