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