---
schema_version: "1"
id: b6e41fff8c787434c4a033dea6a02abe38cff573048faedef544232e3eff54ab
title: MatchResult Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Datacloud_MatchResult.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 1f92dd18528af7006509c8378c3ed7b254c77b912f4d75131a88b2093c922eb8
description: Represents the duplicate results for a matching rule.Returns the entity type of the matching rule.Returns errors that occurred during matching for the matching rule.Returns the match engine for the matching rule.Returns information about the duplicates for the matching rule.Returns the developer name of the matching rule.Returns the number of duplicates detected by the matching rule.Returns false if there’s an error with the matching rule, and true if the matching rule successfully ran.
---
# MatchResult Class

Represents the duplicate results for a matching rule.

## Namespace

[Datacloud](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_datacloud.htm#apex_namespace_datacloud "The Datacloud namespace provides classes and methods for retrieving information about duplicate rules. Duplicate rules let you control whether and when users can save duplicate records within Salesforce.")

- **[MatchResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_methods)**

## MatchResult Methods

The following are methods for MatchResult.

- **[getEntityType()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getEntityType)**  
    Returns the entity type of the matching rule.
- **[getErrors()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getErrors)**  
    Returns errors that occurred during matching for the matching rule.
- **[getMatchEngine()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getMatchEngine)**  
    Returns the match engine for the matching rule.
- **[getMatchRecords()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getMatchRecords)**  
    Returns information about the duplicates for the matching rule.
- **[getRule()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getRule)**  
    Returns the developer name of the matching rule.
- **[getSize()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_getSize)**  
    Returns the number of duplicates detected by the matching rule.
- **[isSuccess()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchResult.htm#apex_Datacloud_MatchResult_isSuccess)**  
    Returns false if there’s an error with the matching rule, and true if the matching rule successfully ran.

### getEntityType()

Returns the entity type of the matching rule.

#### Signature

public String getEntityType()

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

### getErrors()

Returns errors that occurred during matching for the matching rule.

#### Signature

public List<Database.Error> getErrors()

#### Return Value

Type: List<[Database.Error](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_database_error.htm#apex_methods_system_database_error "Represents information about an error that occurred during a DML operation when using a Database method.")\>

### getMatchEngine()

Returns the match engine for the matching rule.

#### Signature

public String getMatchEngine()

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

### getMatchRecords()

Returns information about the duplicates for the matching rule.

#### Signature

public List<Datacloud.MatchRecord> getMatchRecords()

#### Return Value

Type: List<[Datacloud.MatchRecord](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_MatchRecord.htm#apex_class_Datacloud_MatchRecord "Represents a duplicate record detected by a matching rule.")\>

### getRule()

Returns the developer name of the matching rule.

#### Signature

public String getRule()

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

### getSize()

Returns the number of duplicates detected by the matching rule.

#### Signature

public Integer getSize()

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

### isSuccess()

Returns false if there’s an error with the matching rule, and true if the matching rule successfully ran.

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