Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 1.58 KB

File metadata and controls

33 lines (20 loc) · 1.58 KB

Sample: Use duplicate detection when creating and updating records

This sample shows how to invoke duplicate detection for creating and updating table records.

How to run this sample

See How to run samples for information about how to run this sample.

What this sample does

The DuplicateRule method is intended to be used in a scenario where it contains data that is needed to create duplicate detection rule.

How this sample works

In order to simulate the scenario described in What this sample does, the sample will do the following:

Setup

  1. Checks for the current version of the org.
  2. The Account method creates an account record.
  3. The DuplicateRule method creates a duplicate detection rule.
  4. The DuplicateRuleCondition method creates a duplicate detection rule conditions.
  5. The PublishDuplicateRuleRequest method publishes the duplicate detection rule created earlier. You need to wait for publishing operation to complete, so we keep polling the state of the rule until it becomes Published.

Demonstrate

  1. The Account method creates an account record.
  2. The CreateRequest method creates operation by suppressing duplicate detection.
  3. The UpdateRequest method updates the retrieved account record with new account number.

Clean up

Displays an option to delete all the data created in the sample. The deletion is optional in case you want to examine the data created by the sample. You can manually delete the data to achieve same results.