Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Connection Entity plug-in creates Duplicate records

Posted on by 395

Hi,

I created a plug-in on Connection entity for "Create" step. This custom plug-in will create Connection records based on below scenarios.


1. If the user select a specific role and lookup type as "Contact" then i have business logic that creates another connection record against the associated Account of the selected contact. Technically i am creating one more record based on the selection so each time when the user create a connection it creates 2 records.

Ex: Opportunity record -> Click on connection -> Select a Contact and Select a Role mapped to Contact.

This will create 2 records 1 with the actual selection and the other with business logic as defined. 1 against contact and one more against account.

2. Similar way the same plug-in will create a connection with contact if the user select the lookup type as "Account".

Ex: Opportunity record -> Click on Connection -> Select an Account and Select a Role mapped to Account.

This will create 2 records 1 with the actual selection and the other with business logic as defined. 1 against Account and one more against Contact.

Every thing works fine except below scenario.

There are some records in system where a Contact is listed as Primary Contact for an account and the same account is setup as parent account for that contact.
When i select these kind of records its creating continuous entires around 10 records and no control to stop.
we have Many to Many relationship setup for Contact to Account and Account to Contact. I guess because of this its creating these records, is there any way i can stop creating these records in my plug-in or any other best way to stop these duplicate connections?

I also tried to stop the related entity records that is mentioned in below link but this is also not working in the above scenario.

community.dynamics.com/.../problems-with-plugins-on-connection-entity-in-crm-2011

*This post is locked for comments

  • Suggested answer
    Srini20 Profile Picture
    Srini20 395 on at
    RE: Connection Entity plug-in creates Duplicate records

    Thanks Andrew. This has resolved the issue.

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Connection Entity plug-in creates Duplicate records

    Hello,

    Have you considered querying of CRM for existing connection record between account/contact and if connection is there just quit from plugin execution?

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans