---
schema_version: "1"
id: 12a82e1496cf49e5ed2c6174bd7850b03f55ad3c8569aad9a728bd7492b24575
title: DeployResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Metadata_DeployResult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5276f41c88d62fda82b570e14d70365bed65ee5c634f58b4291b3882d573ee07
description: Represents the results of a metadata deployment.ID of the user who canceled the queued deployment.Full name of the user who canceled the queued deployment.Indicates whether the deployment checked only the validity of the deployed files without making changes in the org. A check-only deployment does not deploy components or change the org in any way.Date and time for when the deployment process ended.ID of the user who created the deployment job.Full name of the user who created the deployment job.Date and time the deployment job was first queued.Provides the details for components in a completed deployment.Indicates whether Salesforce finished processing the deployment.Message corresponding to the values in the errorStatusCode property, if any.If an error occurs during deployment, a status code is returned. The message corresponding to the status code is returned in the errorMessagefield property.ID of the deployment job.Specifies whether a deployment continues, even if the deployment generates warnings.Date and time of the last update for the deployment process. A list of all the detail messages for a deployment. The number of components that generated errors during the deployment.The number of components deployed in the deployment process. Use this value with the numberComponentsTotal property to get an estimate of the deployment’s progress.The total number of components in the deployment. Use this value with the numberComponentsDeployed property to get an estimate of the deployment’s progress.Indicates whether any failure causes a complete rollback (true) or not (false) of the deployment.Date and time the deployment process began.Indicates which component is being deployed.Indicates the current state of the deployment.Indicates whether the deployment was successful (true) or not (false).Makes a duplicate copy of the Metadata.DeployResult.
---
# DeployResult Class

Represents the results of a metadata deployment.

## Namespace

[Metadata](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Metadata.htm "The Metadata namespace provides classes and methods for working with custom metadata in Salesforce")

## Usage

After an asynchronous metadata deployment finishes, Salesforce provides an instance of Metadata.DeployResult in a call to your implementation of handleResult() in your [Metadata.DeployCallback](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_interface_Metadata_DeployCallback.htm#apex_interface_Metadata_DeployCallback "An interface for metadata deployment callback classes.") class.

## Example

public void handleResult(Metadata.DeployResult result,
                         Metadata.DeployCallbackContext context) {
    if (result.status == Metadata.DeployStatus.Succeeded) {
        // Deployment was successful
    } else {
        // Deployment was not successful
    }
}

- **[DeployResult Properties](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_properties)**
- **[DeployResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_methods)**

## DeployResult Properties

The following are properties for DeployResult.

- **[canceledBy](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_canceledBy)**  
    ID of the user who canceled the queued deployment.
- **[canceledByName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_canceledByName)**  
    Full name of the user who canceled the queued deployment.
- **[checkOnly](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_checkOnly)**  
    Indicates whether the deployment checked only the validity of the deployed files without making changes in the org. A check-only deployment does not deploy components or change the org in any way.
- **[completedDate](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_completedDate)**  
    Date and time for when the deployment process ended.
- **[createdBy](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_createdBy)**  
    ID of the user who created the deployment job.
- **[createdByName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_createdByName)**  
    Full name of the user who created the deployment job.
- **[createdDate](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_createdDate)**  
    Date and time the deployment job was first queued.
- **[details](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_details)**  
    Provides the details for components in a completed deployment.
- **[done](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_done)**  
    Indicates whether Salesforce finished processing the deployment.
- **[errorMessage](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_errorMessage)**  
    Message corresponding to the values in the errorStatusCode property, if any.
- **[errorStatusCode](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_errorStatusCode)**  
    If an error occurs during deployment, a status code is returned. The message corresponding to the status code is returned in the errorMessagefield property.
- **[id](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_id)**  
    ID of the deployment job.
- **[ignoreWarnings](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_ignoreWarnings)**  
    Specifies whether a deployment continues, even if the deployment generates warnings.
- **[lastModifiedDate](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_lastModifiedDate)**  
    Date and time of the last update for the deployment process.
- **[messages](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_messages)**  
    A list of all the detail messages for a deployment.
- **[numberComponentErrors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_numberComponentErrors)**  
    The number of components that generated errors during the deployment.
- **[numberComponentsDeployed](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_numberComponentsDeployed)**  
    The number of components deployed in the deployment process. Use this value with the numberComponentsTotal property to get an estimate of the deployment’s progress.
- **[numberComponentsTotal](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_numberComponentsTotal)**  
    The total number of components in the deployment. Use this value with the numberComponentsDeployed property to get an estimate of the deployment’s progress.
- **[rollbackOnError](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_rollbackOnError)**  
    Indicates whether any failure causes a complete rollback (true) or not (false) of the deployment.
- **[startDate](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_startDate)**  
    Date and time the deployment process began.
- **[stateDetail](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_stateDetail)**  
    Indicates which component is being deployed.
- **[status](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_status)**  
    Indicates the current state of the deployment.
- **[success](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_success)**  
    Indicates whether the deployment was successful (true) or not (false).

### canceledBy

ID of the user who canceled the queued deployment.

#### Signature

public String canceledBy {get; set;}

#### Property 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.")

### canceledByName

Full name of the user who canceled the queued deployment.

#### Signature

public String canceledByName {get; set;}

#### Property 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.")

### checkOnly

Indicates whether the deployment checked only the validity of the deployed files without making changes in the org. A check-only deployment does not deploy components or change the org in any way.

#### Signature

public Boolean checkOnly {get; set;}

#### Property 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.")

### completedDate

Date and time for when the deployment process ended.

#### Signature

public Datetime completedDate {get; set;}

#### Property Value

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

### createdBy

ID of the user who created the deployment job.

#### Signature

public String createdBy {get; set;}

#### Property 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.")

### createdByName

Full name of the user who created the deployment job.

#### Signature

public String createdByName {get; set;}

#### Property 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.")

### createdDate

Date and time the deployment job was first queued.

#### Signature

public Datetime createdDate {get; set;}

#### Property Value

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

### details

Provides the details for components in a completed deployment.

#### Signature

public Metadata.DeployDetails details {get; set;}

#### Property Value

Type: [Metadata.DeployDetails](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployDetails.htm#apex_class_Metadata_DeployDetails "Contains detailed information on deployed components.")

### done

Indicates whether Salesforce finished processing the deployment.

#### Signature

public Boolean done {get; set;}

#### Property 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.")

### errorMessage

Message corresponding to the values in the errorStatusCode property, if any.

#### Signature

public String errorMessage {get; set;}

#### Property 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.")

### errorStatusCode

If an error occurs during deployment, a status code is returned. The message corresponding to the status code is returned in the errorMessagefield property.

#### Signature

public String errorStatusCode {get; set;}

#### Property 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.")

For a description of each status code value, see [Core Data Types Used in API Calls](https://developer.salesforce.com/docs/atlas.en-us.264.0.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm) in the SOAP API Developer Guide.

### id

ID of the deployment job.

#### Signature

public Id id {get; set;}

#### Property Value

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

### ignoreWarnings

Specifies whether a deployment continues, even if the deployment generates warnings.

#### Signature

public Boolean ignoreWarnings {get; set;}

#### Property 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.")

### lastModifiedDate

Date and time of the last update for the deployment process.

#### Signature

public Datetime lastModifiedDate {get; set;}

#### Property Value

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

### messages

A list of all the detail messages for a deployment.

#### Signature

![Note](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/images/icon_note.png)

#### Note

Removed in API version 29.0 and later.

public List<Metadata.DeployMessage> messages {get; set;}

#### Property Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Metadata.DeployMessage](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployMessage.htm#apex_class_Metadata_DeployMessage "Represents result information for the deployment of a metadata component.")\>

### numberComponentErrors

The number of components that generated errors during the deployment.

#### Signature

public Integer numberComponentErrors {get; set;}

#### Property Value

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

### numberComponentsDeployed

The number of components deployed in the deployment process. Use this value with the numberComponentsTotal property to get an estimate of the deployment’s progress.

#### Signature

public Integer numberComponentsDeployed {get; set;}

#### Property Value

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

### numberComponentsTotal

The total number of components in the deployment. Use this value with the numberComponentsDeployed property to get an estimate of the deployment’s progress.

#### Signature

public Integer numberComponentsTotal {get; set;}

#### Property Value

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

### rollbackOnError

Indicates whether any failure causes a complete rollback (true) or not (false) of the deployment.

#### Signature

public Boolean rollbackOnError {get; set;}

#### Property 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.")

### startDate

Date and time the deployment process began.

#### Signature

public Datetime startDate {get; set;}

#### Property Value

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

### stateDetail

Indicates which component is being deployed.

#### Signature

public String stateDetail {get; set;}

#### Property 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.")

### status

Indicates the current state of the deployment.

#### Signature

public Metadata.DeployStatus status {get; set;}

#### Property Value

Type: [Metadata.DeployStatus](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_Metadata_DeployStatus.htm#apex_enum_Metadata_DeployStatus "The result status of a deployment.")

### success

Indicates whether the deployment was successful (true) or not (false).

#### Signature

public Boolean success {get; set;}

#### Property 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.")

## DeployResult Methods

The following are methods for DeployResult.

- **[clone()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Metadata_DeployResult.htm#apex_Metadata_DeployResult_clone)**  
    Makes a duplicate copy of the Metadata.DeployResult.

### clone()

Makes a duplicate copy of the Metadata.DeployResult.

#### Signature

public Object clone()

#### Return Value

Type: Object