web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to avoid duplicates when creating records using Web API (Java)

(0) ShareShare
ReportReport
Posted on by

Hi there how can i prevent the creation of duplicate record in crm by using web api sdk in java.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: How to avoid duplicates when creating records using Web API (Java)

    Hi ,

    You can create plugin for the respective entity  create event and return error if any duplicate data founds.

  • Abhishek Gupta Profile Picture
    2,003 on at
    RE: How to avoid duplicates when creating records using Web API (Java)

    Yes you can. On click of save, you can check the formtype. If formtype is equal to 1, you can check for the duplicate record. If duplicate record exist, you can restrict system from saving the form. 

    You can refer to below link for same:

    https://neilparkhurst.com/2015/11/11/javascript-prevent-save/

    General practice is to write a server side code through plugin on pre-create event. 

    Using plugin you can restrict duplicate record creation through excel import or record creation through any sort of integration.

    Using javascript,it will only check when user performs creation of record through CRM form.

    Mark answer correct if you find useful.

    Thanks

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to avoid duplicates when creating records using Web API (Java)

    Hello,

    To avoid duplicates to be created use MSCRM.SuppressDuplicateDetection header in your http request. More detailed information can be found here - docs.microsoft.com/.../manage-duplicate-detection-create-update

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: How to avoid duplicates when creating records using Web API (Java)

    Alternatively, you can set alternate keys on the entities to restrict duplicate record. This will ensure that you cannot create a duplicate from anywhere :)

    community.dynamics.com/.../d365-alternate-keys-for-duplicate-detection

    community.dynamics.com/.../define-alternate-keys-for-an-entity

    www.powerobjects.com/.../alternate-keys-as-an-alternative-to-duplicate-detection-rules

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans