简体   繁体   中英

Dynamics CRM 2011 online, custom workflow

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM