سؤال

I am very new to Dynamics and am wanting something which when a lead is created my workflow will create a contact. However I do not want duplicate contacts to be created. I read that duplication detection does not work in workflows and that I need to write a plugin. I am following this tutorial. I have created a EmailExists entity and referenced the Lead entity. What I need to do is get that Lead entity and then check whether or not a contact exists with that leads email address. I'm pretty much stuck on how to get the lead from my custom entity and then query the contactbase. Any suggestions or further reading would be greatly appreciated.

Thanks in advance

هل كانت مفيدة؟

المحلول

The link you reference is a workaround for the problem of not being able to register custom workflow activities in CRM Online. If you are using the On Premise version, you should be able to write custom workflow activities.

If you are already going to write a plugin, you don't need to follow the instructions in that link. You might as well just write a plugin that fires on Pre-Create of the Lead entity. It would go query Contacts for that email address, and if it finds one, it would throw an InvalidPluginExecutionException which will cancel the Create. No need for the "EmailExists" entity.

Here's a step-by-step guide on creating a simple plugin:

http://msdn.microsoft.com/en-us/library/gg695782.aspx

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top