Record Exception Error Includes Information About Compound Fields and Duplicate Records

When something goes wrong with a record update or create operation, a Record Exception Error response body may be returned. This response body now includes information about errors that occur due to a constituent field of a compound field, and errors that occur due to duplicate records.

Duplicate rules control whether and when you can save duplicate records in Salesforce. Duplicate rules tell Salesforce what action to take when you attempt to create a duplicate record. Each duplicate rule requires at least one matching rule to identify which existing records are possible duplicates.

Record Exception Errors response body
Property Name Type Description Filter Group and Version Available Version
constituentField String If the field is a constituent of a compound field, this property contains the API name of the constituent field, and the field property contains the API name of the compound field.

If the field is not a constituent of a compound field, or if no field applies to the error, the value is null.

Small, 40.0 40.0
duplicateRecordError Duplicate Record Error Information about possible duplicate records. When the error code is DUPLICATES_DETECTED, this property might contain a value. Small, 40.0 40.0
field String A field API name. If no field applies to the error, the value is null. Small, 39.0 39.0
fieldLabel String A field label. If no field applies to the error, the value is null. Small, 39.0 39.0
message String An error message. Small, 39.0 39.0
statusCode String An error status code. Small, 39.0 39.0
Duplicate Record Error response body
Property Name Type Description Filter Group and Version Available Version
matchResults Match Result[] A collection of duplicate rule match results. Each duplicate rule requires at least one matching rule to identify which existing records are possible duplicates. Small, 40.0 40.0
Match Result response body
Property Name Type Description Filter Group and Version Available Version
apiName String The API name of the object. Small, 40.0 40.0
isAllowSave Boolean Indicates whether the rule allows a duplicate to be saved. Big, 40.0 40.0
matchRecordIds String[] The IDs of the matching records. Small, 40.0 40.0
matchRule String The developer name of the matching duplicate rule. Big, 40.0 40.0