Prevent Server Side Duplicate Records using Assembly Code

The app enables users to prevent duplicates when creating new records and updating existing records on the server side programmatically using the Assembly, WPF Application, and Data Import processes.

Here’s how you can prevent duplicates using assembly code with DeDupeD:

To prevent duplicates on the server side, first configure the server-side settings, and then you’ve to pass “SuppressDuplicateDetection” inside your code as false while creating or updating the record. Passing a false parameter will prevent the creation of duplicate records.

If you still want to allow duplicates, then again configure the server-side settings, or else pass “SuppressDuplicateDetection” inside the code as true while creating or updating the record.

To summarize the "SuppressDuplicateDetection" parameter, you will have to pass the below values as per the requirement:

  • True – To create or update the record if a duplicate is found.

  • False – To not create or update the record if a duplicate is found.

Entity target = new Entity(“account”);
target[“name”] = “Ryan”;
CreateRequest req = new CreateRequest();
req.Target = target;
req["SuppressDuplicateDetection"] = false;
CreateResponse response = (CreateResponse)service.Execute(req);
Entity target = new Entity(“account”,new Guid(“15861e65-5f58-ee11-a332-00155d06340c”));
target[“name”] = “Ryan”;
UpdateRequest req = new UpdateRequest  ();
req.Target = target;
req[“SuppressDuplicateDetection”] = false;
UpdateResponse response = (UpdateResponse)service.Execute(req);

Note: During creating or updating records, you will have to use Service.Execute request, you won’t be able to use SuppressDuplicateDetection with Service.Create or Service.Update.

For further queries, reach out to us at crm@inogic.com

Last updated