---
schema_version: "1"
id: bbeec531d8455e0862b85f310e783fc631168ff271d14d8e38325c8009c7b974
title: FieldDiff Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Datacloud_FieldDiff.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_FieldDiff.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 61dac3d4065bfceedd981bddae404148a176915cbac44def40c1b37bff6ebb8b
description: Represents the name of a matching rule field and how the values of the field compare for the duplicate and its matching record.Returns how the field values compare for the duplicate and its matching record.Returns the name of a field on a matching rule that detected duplicates.
---
# FieldDiff Class

Represents the name of a matching rule field and how the values of the field compare for the duplicate and its matching record.

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

- **[FieldDiff Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_FieldDiff.htm#apex_Datacloud_FieldDiff_methods)**

## FieldDiff Methods

The following are methods for FieldDiff.

- **[getDifference()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_FieldDiff.htm#apex_Datacloud_FieldDiff_getDifference)**  
    Returns how the field values compare for the duplicate and its matching record.
- **[getName()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Datacloud_FieldDiff.htm#apex_Datacloud_FieldDiff_getName)**  
    Returns the name of a field on a matching rule that detected duplicates.

### getDifference()

Returns how the field values compare for the duplicate and its matching record.

#### Signature

public String getDifference()

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

Possible values include:

- SAME: Indicates the field values match exactly.
- DIFFERENT: Indicates that the field values do not match.
- NULL: Indicates that the field values are a match because both values are blank.

### getName()

Returns the name of a field on a matching rule that detected duplicates.

#### Signature

public String getName()

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