<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Writing Bulk Triggers for Salesforce.com</title>
	<atom:link href="http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=writing-bulk-triggers-for-salesforce</link>
	<description>Get your head out of your #@! and into the clouds!</description>
	<lastBuildDate>Wed, 08 Feb 2012 07:57:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Wiktor</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-3151</link>
		<dc:creator>Wiktor</dc:creator>
		<pubDate>Thu, 07 Apr 2011 09:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-3151</guid>
		<description>Thanks, great walkthrough. I always have problems with those stupid triggers. But why customer always wants functionality where [select] in loop is the simplest way to solve ;D</description>
		<content:encoded><![CDATA[<p>Thanks, great walkthrough. I always have problems with those stupid triggers. But why customer always wants functionality where [select] in loop is the simplest way to solve ;D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Douglas</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-2132</link>
		<dc:creator>Jeff Douglas</dc:creator>
		<pubDate>Wed, 01 Dec 2010 12:38:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-2132</guid>
		<description>@Yacine, if you are using a DE org try to creating too many users in your test code to generate the exception.</description>
		<content:encoded><![CDATA[<p>@Yacine, if you are using a DE org try to creating too many users in your test code to generate the exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fandi yacine</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-2106</link>
		<dc:creator>Fandi yacine</dc:creator>
		<pubDate>Thu, 25 Nov 2010 10:01:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-2106</guid>
		<description>Hi Jeff
I would like to see if its possible a small example on dealing with the LICENSE_LIMIT_EXCEEDED.
is it meant to be an exception handling in a &quot;catch&quot;
try{
  insert u;
}
catch(Exception e )
{
 if ( e=&#039;LICENSE_LIMIT_EXCEEDED&#039;)
  // do something 
}

OR is something like this :
 Database.SaveResult sr = insert u;
 if(sr.isSuccess()){
         // Indicates success  
  }
 else {
     Database.Error err = sr.getErrors()[0];
     if(err.getStatusCode() == StatusCode.LICENSE_LIMIT_EXCEEDED )
 // indicates error
  }
}

Thanks for your help
Yacine</description>
		<content:encoded><![CDATA[<p>Hi Jeff<br />
I would like to see if its possible a small example on dealing with the LICENSE_LIMIT_EXCEEDED.<br />
is it meant to be an exception handling in a &#8220;catch&#8221;<br />
try{<br />
  insert u;<br />
}<br />
catch(Exception e )<br />
{<br />
 if ( e=&#8217;LICENSE_LIMIT_EXCEEDED&#8217;)<br />
  // do something<br />
}</p>
<p>OR is something like this :<br />
 Database.SaveResult sr = insert u;<br />
 if(sr.isSuccess()){<br />
         // Indicates success<br />
  }<br />
 else {<br />
     Database.Error err = sr.getErrors()[0];<br />
     if(err.getStatusCode() == StatusCode.LICENSE_LIMIT_EXCEEDED )<br />
 // indicates error<br />
  }<br />
}</p>
<p>Thanks for your help<br />
Yacine</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harry</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-1271</link>
		<dc:creator>Harry</dc:creator>
		<pubDate>Fri, 30 Jul 2010 20:28:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-1271</guid>
		<description>This is an excellent post ! I was doing everything that you pointed in the &quot;How not to write &quot; section.  I know better now.</description>
		<content:encoded><![CDATA[<p>This is an excellent post ! I was doing everything that you pointed in the &#8220;How not to write &#8221; section.  I know better now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Douglas</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-150</link>
		<dc:creator>Jeff Douglas</dc:creator>
		<pubDate>Tue, 20 Apr 2010 10:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-150</guid>
		<description>Amanda, not being familiar with your code I would recommend looking at two things: 1) you could use &lt;a href=&quot;http://blog.jeffdouglas.com/2009/11/02/using-saleforce-dml-statements-or-dml-database-methods/&quot; rel=&quot;nofollow&quot;&gt;DML database methods&lt;/a&gt; to let records fail gracefully that are duplicates 2) I&#039;m not sure what the collection &lt;em&gt;theCampaignMembers&lt;/em&gt; contains but if you want to prevent duplicates you&#039;ll have to check the lead against ones that exist in the database. It looks like the expression above just checks to see if the collection is not null and if so, inserts it&#039;s records. I don&#039;t believe it does any type of dupe checking.</description>
		<content:encoded><![CDATA[<p>Amanda, not being familiar with your code I would recommend looking at two things: 1) you could use <a href="http://blog.jeffdouglas.com/2009/11/02/using-saleforce-dml-statements-or-dml-database-methods/" rel="nofollow">DML database methods</a> to let records fail gracefully that are duplicates 2) I&#8217;m not sure what the collection <em>theCampaignMembers</em> contains but if you want to prevent duplicates you&#8217;ll have to check the lead against ones that exist in the database. It looks like the expression above just checks to see if the collection is not null and if so, inserts it&#8217;s records. I don&#8217;t believe it does any type of dupe checking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amanda</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-149</link>
		<dc:creator>Amanda</dc:creator>
		<pubDate>Mon, 19 Apr 2010 23:36:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-149</guid>
		<description>I have successfully created a trigger to auto-add leads to a campaign based on my own set criteria (with the help of Scott Hemmeter&#039;s post of code).  However (after the first insertion of the lead into the appropriate campaign), I get an error of “DUPLICATE_VALUE, This entity is already a member of this campaign: []” any time I try to edit the lead for any other reason.

I thought the last line of the code (below) handled this error and I’m now pulling my hair out trying to familiarize myself with the Apex language.

if(!theCampaignMembers.isEmpty()){
insert theCampaignMembers;
}

Has anyone faced this problem or come up with a solution? It seems like one quick, conditional line right before the “insert” should do it (somehow checking if the lead is already a campaign member), but my attempts seem completely futile. Please help!</description>
		<content:encoded><![CDATA[<p>I have successfully created a trigger to auto-add leads to a campaign based on my own set criteria (with the help of Scott Hemmeter&#8217;s post of code).  However (after the first insertion of the lead into the appropriate campaign), I get an error of “DUPLICATE_VALUE, This entity is already a member of this campaign: []” any time I try to edit the lead for any other reason.</p>
<p>I thought the last line of the code (below) handled this error and I’m now pulling my hair out trying to familiarize myself with the Apex language.</p>
<p>if(!theCampaignMembers.isEmpty()){<br />
insert theCampaignMembers;<br />
}</p>
<p>Has anyone faced this problem or come up with a solution? It seems like one quick, conditional line right before the “insert” should do it (somehow checking if the lead is already a campaign member), but my attempts seem completely futile. Please help!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rich</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-148</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Sun, 21 Jun 2009 00:58:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-148</guid>
		<description>We&#039;re aware of this issue, and it looks like we&#039;ll be addressing it in the next major release.</description>
		<content:encoded><![CDATA[<p>We&#8217;re aware of this issue, and it looks like we&#8217;ll be addressing it in the next major release.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miguel</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-147</link>
		<dc:creator>Miguel</dc:creator>
		<pubDate>Tue, 26 May 2009 17:29:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-147</guid>
		<description>Nice résumé :)
great code and it&#039;s wonderfull to see other people having the same problem I have each day ;)

Cheers,
Miguel</description>
		<content:encoded><![CDATA[<p>Nice résumé <img src='http://blog.jeffdouglas.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
great code and it&#8217;s wonderfull to see other people having the same problem I have each day <img src='http://blog.jeffdouglas.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Cheers,<br />
Miguel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Hemmeter</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-146</link>
		<dc:creator>Scott Hemmeter</dc:creator>
		<pubDate>Wed, 22 Apr 2009 00:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-146</guid>
		<description>I posted about my first experience &quot;bulkifying&quot; a trigger.  See &lt;a href=&quot;http://sfdc.arrowpointe.com/2008/09/13/bulkifying-a-trigger-an-example/&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; for a before and after look at a trigger I wrote.

Thought it&#039;d be a good example for people.

Nice post.</description>
		<content:encoded><![CDATA[<p>I posted about my first experience &#8220;bulkifying&#8221; a trigger.  See <a href="http://sfdc.arrowpointe.com/2008/09/13/bulkifying-a-trigger-an-example/" rel="nofollow">this post</a> for a before and after look at a trigger I wrote.</p>
<p>Thought it&#8217;d be a good example for people.</p>
<p>Nice post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jeffdonthemic</title>
		<link>http://blog.jeffdouglas.com/2009/04/20/writing-bulk-triggers-for-salesforce/comment-page-1/#comment-145</link>
		<dc:creator>jeffdonthemic</dc:creator>
		<pubDate>Mon, 20 Apr 2009 16:57:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jeffdouglas.com/?p=774#comment-145</guid>
		<description>David, you are 100% correct regarding the user license. If you run this in a Developer org you will get the dreaded &quot;LICENSE_LIMIT_EXCEEDED&quot; error message. I happened to write this in one of our sandboxes. Thanks for reminding me to clarify this. You can always query for an existing user instead of creating one. I think the license limit should not be taken into account when running tests. I have a sneaky suspicion that you do also. THANKS!</description>
		<content:encoded><![CDATA[<p>David, you are 100% correct regarding the user license. If you run this in a Developer org you will get the dreaded &#8220;LICENSE_LIMIT_EXCEEDED&#8221; error message. I happened to write this in one of our sandboxes. Thanks for reminding me to clarify this. You can always query for an existing user instead of creating one. I think the license limit should not be taken into account when running tests. I have a sneaky suspicion that you do also. THANKS!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

