Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
DuplicateRuleHeader
Determines options for using duplicate rules to detect duplicate records. Duplicate
rules are part of the Duplicate Management feature.
Fields
| Element Name | Type | Description |
|---|---|---|
| allowSave | boolean | For a duplicate rule, when the Alert option is enabled, bypass alerts and save duplicate records by setting this property to true. Prevent duplicate records from being saved by setting this property to false. |
| includeRecordDetails | boolean | Get fields and values for records detected as duplicates by setting this property to true. Get only record IDs for records detected as duplicates by setting this property to false. |
| runAsCurrentUser | boolean | Make sure that sharing rules for the current user are enforced when duplicate rules run by setting this property to true. Use the sharing rules specified in the class for the request by setting this property to false. 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);