Question

I have a requirement to copy all Notes and Activities while converting Lead to Contact and vice versa.

When I Qualifying Lead to Contact I use my custom plugin which is triggered by QualifyLead event. There is no out of the box solution to convert Contact to Lead so I use my custom on-demand dialog. But this dialog unable to run my custom plugin (which will copy Notes and Activities from Contact to Lead).

Please help me to find a way to copy all this stuff from Contact to Lead.

Was it helpful?

Solution

You can create a Custom Workflow Activity with the code of your custom plugin and uses as step inside your on-demand dialog.

You can start from here:

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

OTHER TIPS

Another way that you can do this is to simply reference the notes from the Lead in the Contact, Account, or Opportunity entities using an IFrame and some JavaScript as described in http://030bacf.netsolhost.com/WordPress/?cat=69 . Depending on how many records you have, potentially this could even be a better solution since you are only keeping one copy of the notes which will help keep the size of the database more manageable and performance better. Or you could use this solution for the notes and the solution recommended by Guido for the Activity records. I had to make a change to the URL used for CRM 2013 and have copied that part below.

//src="/"+context.getContext().getOrgUniqueName()+"/_controls/note/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false";
// change to this for CRM 2013
src=serverUrl+"/"+Xrm.Page.context.prependOrgName("/_controls/notes/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top