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.

ActionResult Class

Contains information about the execution of an actionable notification.

Namespace

Messaging

Usage

This ActionResult instance represents the successful execution of an actionable notification.

1Messaging.ActionResult result = 
2new Messaging.ActionResult.Builder()
3.withSuccess(true)
4.withMessage('Action is executed successfully')
5.build();
This ActionResult instance represents the unsuccessful execution of an actionable notification.
1Messaging.ActionResult result = 
2new Messaging.ActionResult.Builder()
3.withSuccess(false) 
4.withMessage('Error updating case')
5.withErrorCode(Messaging.ActionError.INTERNAL_ERROR)
6.build();

ActionResult Methods

The following are methods for ActionResult.

getErrorCode()

If an error occurred, returns an object that provides the error code and a description.

Signature

public Messaging.ActionError getErrorCode()

Return Value

Type: Messaging.ActionError

getMessage()

Returns the success or error message that displays for the user.

Signature

public String getMessage()

Return Value

Type: String

isSuccess()

Returns true if the action executed successfully; otherwise returns false.

Signature

public Boolean isSuccess()

Return Value

Type: Boolean