---
schema_version: "1"
id: 23c8e36a5b68b372cff4503dbdbbb216fdddeccaaa81d8d19ea445b2fd4a6d22
title: ActionResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Messaging_ActionResult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_ActionResult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4ca74bd4db68593443b8fb561a13e41f8cc94fa7b392f46b1ccab36b06bf731f
description: Contains information about the execution of an actionable notification. If an error occurred, returns an object that provides the error code and a description.Returns the success or error message that displays for the user.Returns true if the action executed successfully; otherwise returns false.
---
# ActionResult Class

Contains information about the execution of an actionable notification.

## Namespace

[Messaging](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Messaging.htm "The Messaging namespace provides classes and methods for Salesforce notifications and email functionality.")

## Usage

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

Messaging.ActionResult result = 
new Messaging.ActionResult.Builder()
.withSuccess(true)
.withMessage('Action is executed successfully')
.build();

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

Messaging.ActionResult result = 
new Messaging.ActionResult.Builder()
.withSuccess(false) 
.withMessage('Error updating case')
.withErrorCode(Messaging.ActionError.INTERNAL\_ERROR)
.build();

- **[ActionResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_ActionResult.htm#apex_Messaging_ActionResult_methods)**

## ActionResult Methods

The following are methods for ActionResult.

- **[getErrorCode()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_ActionResult.htm#apex_Messaging_ActionResult_getErrorCode)**  
    If an error occurred, returns an object that provides the error code and a description.
- **[getMessage()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_ActionResult.htm#apex_Messaging_ActionResult_getMessage)**  
    Returns the success or error message that displays for the user.
- **[isSuccess()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Messaging_ActionResult.htm#apex_Messaging_ActionResult_isSuccess)**  
    Returns true if the action executed successfully; otherwise returns false.

### 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_Messaging_ActionError.htm "Specifies the error that occurred during the execution of an actionable notification.")

### getMessage()

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

#### Signature

public String getMessage()

#### Return Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### isSuccess()

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

#### Signature

public Boolean isSuccess()

#### Return Value

Type: [Boolean](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_boolean.htm#apex_methods_system_boolean "Contains methods for the Boolean primitive data type.")