Newer Version Available

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

DuplicateRuleHeader

Determines options for using duplicate rules to detect duplicate records. Duplicate rules are part of the Duplicate Management feature.

API Calls

create(), update(), upsert()

Fields

Element Name Type Description
allowSave boolean Set to true to save the duplicate record. Set to false to prevent the duplicate record from being saved.
includeRecordDetails boolean Set to true to get fields and values for records detected as duplicates. Set to false to get only record IDs for records detected as duplicates.
runAsCurrentUser boolean Set to true to make sure that sharing rules for the current user are enforced when duplicate rules run. Set to false to use the sharing rules specified in the class for the request. If no sharing rules are specified, Apex code runs in system context and sharing rules for the current user are not enforced.

Java Sample

This sample shows how to use the DuplicateRuleHeader to set options for using duplicate rules. To see the entire sample application, see DuplicateResult.

1_DuplicateRuleHeader header = new _DuplicateRuleHeader();
2        header.setAllowSave(false);
3        header.setIncludeRecordDetails(true);
4        header.setRunAsCurrentUser(true);
5
6        binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "DuplicateRuleHeader", header);