Newer Version Available

This content describes an older version of this product. View Latest

DuplicateError Class

Contains information about an error that occurred when an attempt was made to save a duplicate record. Use if your organization has set up duplicate rules, which are part of the Duplicate Management feature.

Namespace

Database

Example

When you try to save a record that’s identified as a duplicate record by a duplicate rule, you’ll receive a duplicate error. If the duplicate rule contains the Allow action, an attempt will be made to bypass the error.

DuplicateError Methods

The following are methods for DuplicateError.

getDuplicateResult()

Returns the details of a duplicate rule and duplicate records found by the duplicate rule.

Signature

public Datacloud.DuplicateResult getDuplicateResult()

Return Value

Type: Datacloud.DuplicateResult

Example

This example shows the code used to get the possible duplicates and related match information after saving a new contact. This code is part of a custom application that implements duplicate management when users add a contact. See DuplicateResult Class to check out the entire sample applicaton.

getFields()

Returns an array of one or more field names. Identifies which fields in the object, if any, affected the error condition.

Signature

public List<String> getFields()

Return Value

Type: List<String>

getMessage()

Returns the error message text.

Signature

public String getMessage()

Return Value

Type: String

getStatusCode()

Returns a code that characterizes the error.

Signature

public StatusCode getStatusCode()

Return Value

Type: StatusCode