Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by Microsoft Employee

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

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 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.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 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

  • Abhishek Gupta Profile Picture
    Abhishek Gupta 2,001 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

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans