<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Auto-Create Campaign Members for New Leads</title>
	<atom:link href="http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/feed/" rel="self" type="application/rss+xml" />
	<link>http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/</link>
	<description>Authored by Scott Hemmeter of Arrowpointe Corp, this blog is written from the perspective of a Salesforce.com solution provider and contains information on Arrowpointe's AppExchange products as well as tips, findings, sample code, functionality wishes, etc.</description>
	<pubDate>Fri, 05 Dec 2008 01:13:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Bookmarks about Appexchange</title>
		<link>http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/#comment-60616</link>
		<dc:creator>Bookmarks about Appexchange</dc:creator>
		<pubDate>Wed, 20 Aug 2008 22:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://sfdc.arrowpointe.com/?p=311#comment-60616</guid>
		<description>[...] - bookmarked by 1 members originally found by maizanessarox on 2008-08-06  Auto-Create Campaign Members for New Leads  http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/ - bookmarked by [...]</description>
		<content:encoded><![CDATA[<p>[...] - bookmarked by 1 members originally found by maizanessarox on 2008-08-06  Auto-Create Campaign Members for New Leads  <a href="http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/" rel="nofollow">http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/</a> - bookmarked by [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Hemmeter</title>
		<link>http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/#comment-60060</link>
		<dc:creator>Scott Hemmeter</dc:creator>
		<pubDate>Thu, 26 Jun 2008 16:11:15 +0000</pubDate>
		<guid isPermaLink="false">http://sfdc.arrowpointe.com/?p=311#comment-60060</guid>
		<description>@Steve

Thanks for the bulk safe tips.  I will modify.

I assume you know that you can include Campaign ID and Member Status in the HTML your web to lead forms and have that information populated without Apex, right?  This solution will essentially let you have a specific campaign in your HTML (ABC Campaign - Landing Page XYX) and have a Campaign populated by Apex based upon lead source (e.g. Web Campaigns).  The end result is a new lead with 2 Campaigns associated to it.</description>
		<content:encoded><![CDATA[<p>@Steve</p>
<p>Thanks for the bulk safe tips.  I will modify.</p>
<p>I assume you know that you can include Campaign ID and Member Status in the HTML your web to lead forms and have that information populated without Apex, right?  This solution will essentially let you have a specific campaign in your HTML (ABC Campaign - Landing Page XYX) and have a Campaign populated by Apex based upon lead source (e.g. Web Campaigns).  The end result is a new lead with 2 Campaigns associated to it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Andersen</title>
		<link>http://sfdc.arrowpointe.com/2008/06/19/auto-create-campaign-members-for-new-leads/#comment-60020</link>
		<dc:creator>Steve Andersen</dc:creator>
		<pubDate>Fri, 20 Jun 2008 01:58:27 +0000</pubDate>
		<guid isPermaLink="false">http://sfdc.arrowpointe.com/?p=311#comment-60020</guid>
		<description>Nice work Scott!

I've got a similar trigger--I'm actually passing in the Campaign Id since I'm in control of my Lead forms.

The only thing I would say is you could make it bulk safe so that it works for batches up to 200. The main trick with balk-safing your triggers is pulling all your SOQL and DML statements out of loops. You only get 20 DML statements and I can't recall right now how many SOQL statements.

It's possible in almost all cases to make stuff bulk safe, but it sure makes the code more complex and harder to understand! In this case you'd have to collect all your LeadSources in a Set and then do a SOQL for all the campaigns where the name is in that set. Then that result would have to be in a Map so you can make the "join" between the Lead and the Campaign Id.

I'm sure you've looked into this already since you've got the trigger.new.size protection in there so it won't run in bulk.

Congrats on the nice piece on the wiki! You've earned it!</description>
		<content:encoded><![CDATA[<p>Nice work Scott!</p>
<p>I&#8217;ve got a similar trigger&#8211;I&#8217;m actually passing in the Campaign Id since I&#8217;m in control of my Lead forms.</p>
<p>The only thing I would say is you could make it bulk safe so that it works for batches up to 200. The main trick with balk-safing your triggers is pulling all your SOQL and DML statements out of loops. You only get 20 DML statements and I can&#8217;t recall right now how many SOQL statements.</p>
<p>It&#8217;s possible in almost all cases to make stuff bulk safe, but it sure makes the code more complex and harder to understand! In this case you&#8217;d have to collect all your LeadSources in a Set and then do a SOQL for all the campaigns where the name is in that set. Then that result would have to be in a Map so you can make the &#8220;join&#8221; between the Lead and the Campaign Id.</p>
<p>I&#8217;m sure you&#8217;ve looked into this already since you&#8217;ve got the trigger.new.size protection in there so it won&#8217;t run in bulk.</p>
<p>Congrats on the nice piece on the wiki! You&#8217;ve earned it!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
