-
Notifications
You must be signed in to change notification settings - Fork 0
The Duplicates.DuplicateResult Class
GitHub Action edited this page Nov 11, 2025
·
1 revision
Represents the duplicate detection result for a specific record from a specific duplicate rule.
This class wraps Datacloud.DuplicateResult and contains information about whether saving is allowed and the match results from the duplicate rule.
| Property Name | Data Type | Details |
|---|---|---|
| allowSave | Boolean | Indicates whether saving the record is allowed despite duplicates. Read-only. |
| duplicateRule | String | The name of the duplicate rule that was evaluated. Read-only. |
| duplicateRuleEntityType | String | The entity type of the duplicate rule. Read-only. |
| errorMessage | String | Any error message from the duplicate detection operation. Read-only. |
| matchResults | List<Duplicates.MatchResult> | List of match results containing matching records and their details. Read-only. |
Returns the name of the duplicate rule that was evaluated.
String getDuplicateRule()
Duplicates.DuplicateResult dupResult = result.getDuplicateResults()?.get(0);
String ruleName = dupResult?.getDuplicateRule();
System.debug('Rule: ' + ruleName);Returns the entity type of the duplicate rule.
String getDuplicateRuleEntityType()
String entityType = dupResult?.getDuplicateRuleEntityType();Returns any error message from the duplicate detection.
String getErrorMessage()
String errorMsg = dupResult?.getErrorMessage();Returns the match results for this record.
List<Duplicates.MatchResult> getMatchResults()
List<Duplicates.MatchResult> matches = dupResult?.getMatchResults();
for (Duplicates.MatchResult match : matches) {
System.debug('Match Engine: ' + match.getMatchEngine());
}Returns whether the duplicate detection allows saving the record.
Boolean isAllowSave()
if (dupResult?.isAllowSave()) {
System.debug('Save is allowed');
} else {
System.debug('Save is blocked');
}Returns the underlying native Datacloud.DuplicateResult instance.
Datacloud.DuplicateResult toDatacloudType()
Datacloud.DuplicateResult nativeResult = dupResult?.toDatacloudType();- Generating Test Records
- Dml
- Soql
- Cmdt
- Duplicates
- Plugins
- DatabaseLayer
- Dml
- MockDml
- MockRecord
- Cmdt
- MockCmdt
- Duplicates
- MockDuplicates
- MockSoql
-
Soql
- Soql.AggregateResult
- Soql.Aggregation
- Soql.Binder
- Soql.Builder
- Soql.Condition
- Soql.ConditionalLogic
- Soql.Criteria
- Soql.Cursor
- Soql.Function
- Soql.InnerQuery
- Soql.InvalidParameterValueException
- Soql.LogicType
- Soql.NullOrder
- Soql.Operation
- Soql.Operator
- Soql.ParentField
- Soql.PreAndPostProcessor
- Soql.QueryLocator
- Soql.Request
- Soql.Scope
- Soql.Selectable
- Soql.SortDirection
- Soql.SortOrder
- Soql.Subquery
- Soql.TypeOf
- Soql.Usage
- Soql.WhenClause