Answered by:
Converting Campaign Response

Question
-
Hi everyone,
I work on CRM 4.0 customization and I have an unanswered question concerning "Campaign Response" entity.
I wonder how to customize the process of Response convertion into a lead.
When my campaign response is populated with "New customer" details, then some fields of the new lead are populated but when my campaign response is from an existing customer, none of these fields are populated... I looked for the mapped fields between "Campaign Response entity" and "Lead" but I can't find any.
Does anybbody know how to push information from Campaign Reponse to a Lead in order to pre populate the new lead?
I hope I was clear in my explanations.
Thanks.
MS CRM 4.0, VS 2008Thursday, March 26, 2009 11:19 AM
Answers
-
Hi,
This is not straight forward, but there are a couple of possible solutions.
Some conditions:
It is not possible to do this with workflow, there are no relationship made between lead and campaign response activity.
It is not possible to make a relationship N:1 from lead to campaign response; which could have given us a link, and made it possible to update fields from Lead
The convert to lead only copies the 6 fields, and is not that smart that it copies implicit info from the existing customer.
Solution:
- Create a plugin that populates fields in campaign reponse when existing customer is selected. Then it will work for both existing and new customers.
- or, create your own ISV button, that calls the SDK to close the existing Campaign Response (SetStateDynamicEntityRequest), and that creates the new lead (ex. http://msdn.microsoft.com/en-us/library/cc677070.aspx) with relevant fields copied directly or indirectly from the campaign response activity. (requires SDK understanding).
Morten- Marked as answer by DavidJennawayMVP, Moderator Sunday, May 31, 2009 7:29 PM
Saturday, April 11, 2009 11:18 PM
All replies
-
Hi,
This is not straight forward, but there are a couple of possible solutions.
Some conditions:
It is not possible to do this with workflow, there are no relationship made between lead and campaign response activity.
It is not possible to make a relationship N:1 from lead to campaign response; which could have given us a link, and made it possible to update fields from Lead
The convert to lead only copies the 6 fields, and is not that smart that it copies implicit info from the existing customer.
Solution:
- Create a plugin that populates fields in campaign reponse when existing customer is selected. Then it will work for both existing and new customers.
- or, create your own ISV button, that calls the SDK to close the existing Campaign Response (SetStateDynamicEntityRequest), and that creates the new lead (ex. http://msdn.microsoft.com/en-us/library/cc677070.aspx) with relevant fields copied directly or indirectly from the campaign response activity. (requires SDK understanding).
Morten- Marked as answer by DavidJennawayMVP, Moderator Sunday, May 31, 2009 7:29 PM
Saturday, April 11, 2009 11:18 PM -
I'm going to risk hijacking this thread, but I'm not sure if the above post marked as the answer tells the whole story.
I just tried this using a Workflow...creating a new Lead, copying values from the response record to the new Lead record, and then closing the response record.
This all worked fine...does anyone see this differently?
Thanks.
- Proposed as answer by TaarikZ Wednesday, December 15, 2010 6:29 PM
Wednesday, December 15, 2010 6:28 PM -
To add to what Morten said, the mapping is not customizable, the way we got around it is to create a plugin, hook into the lead on pre-create synchronously and check if the campainid is set and write logic to extract the data, see code below
public void Execute(IPluginExecutionContext context)
{
if (context.Depth != 1) { return; }
DynamicEntity entity = context.InputParameters.Properties["Target"] as DynamicEntity;
if (entity != null)
{
if (entity.Properties.Contains("campaignid") && entity.Properties.Contains("subject")) // must be a converted field enquiry/campaign response
{
string description = ""; // get whatever fields you need from here or lookup the campaign/campaignresponse
if (entity.Properties.Contains("description")) { entity.Properties.Remove("description"); }
entity.Properties.Add(new StringProperty("description", description));
}
}
}
Kids don't try this at home!Thursday, December 16, 2010 10:00 AM