<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Force.com Blogs</title>
	
	<link>http://blogs.developerforce.com</link>
	<description />
	<lastBuildDate>Wed, 19 Jun 2013 16:49:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SforceBlog" /><feedburner:info uri="sforceblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>SforceBlog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/SforceBlog" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FSforceBlog" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Advice for Developers New to the Salesforce Platform</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/2dsDElAlXQA/advice-for-developers-new-to-the-salesforce-platform.html</link>
		<comments>http://blogs.developerforce.com/developer-relations/2013/06/advice-for-developers-new-to-the-salesforce-platform.html#comments</comments>
		<pubDate>Wed, 19 Jun 2013 16:49:14 +0000</pubDate>
		<dc:creator>Reid Carlberg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[salesforce platform]]></category>

		<guid isPermaLink="false">http://26.14481</guid>
		<description><![CDATA[What one piece of advice would you offer to an experience developer working on the Salesforce Platform for the first time?  I asked our developer evangelist team.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re about to kick off your first Salesforce Platform project, congratulations!  You&#8217;re joining a vibrant community doing interesting work.  But you might be wondering where to start.  I recently asked my fellow <a href="https://twitter.com/forcedotcom/developer-evangelists">developer evangelists</a> this very question.</p>
<p>Here&#8217;s what everyone said.  I think you&#8217;ll start to notice a theme.</p>
<ul>
<li><a href="https://twitter.com/rajaraodv">Raja Rao DV</a> &#8212; Go through the <a href="http://wiki.developerforce.com/page/Force.com_workbook">workbooks</a>, understand the system, then start developing.</li>
<li><a href="http://twitter.com/ryanjupton">Ryan Upton</a> &#8212; Workbooks. <a href="http://www.salesforce.com/us/developer/docs/workbook/index.htm">Force.com first</a>, then <a href="http://www.salesforce.com/us/developer/docs/apex_workbook/index.htm">Apex</a>. Hang out on the <a href="http://boards.developerforce.com/">developer boards</a>.</li>
<li><a href="http://twitter.com/metadaddy">Pat &#8220;Metadaddy&#8221; Patterson</a> &#8212; Do the workbooks, read <a href="http://www.developerforce.com/media/ForcedotcomBookLibrary/Force.com_Multitenancy_WP_101508.pdf">the multitenant white paper</a>.</li>
<li><a href="http://twitter.com/Samantha_Ready">Samantha Ready</a> &#8212; Get a <a href="https://events.developerforce.com/signup">Developer Edition org</a>, hang out on <a href="http://salesforce.stackexchange.com/">Stack Exchange</a>, and remember to Google.</li>
<li><a href="http://twitter.com/pchittum">Peter Chittum</a> &#8212; Get to know how our <a href="http://salesforce.stackexchange.com/questions/1090/what-is-metadata">metadata</a> (<a href="http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_intro.htm">api overview</a>) and <a href="http://www.salesforce.com/us/developer/docs/workbook_security/index.htm">security settings</a> work.</li>
<li><a href="http://twitter.com/jr0cket">John Stevenson</a> &#8212; Go to your local <a href="http://wiki.developerforce.com/page/Force.com_User_Groups">Force.com developer user group</a> and build relationships with other developers.</li>
<li><a href="http://twitter.com/joshbirk">Josh Birk</a> &#8212; Developer edition: get it, love it. Get to know <a href="http://developer.force.com">developer.force.com</a> and watch Force.com Fridays.</li>
<li><a href="http://twitter.com/cloudysan">Sandeep Bhanot</a> &#8212; Bookmark developer.force.com &amp; follow the <a href="http://twitter.com/ForceDotCom">@ForceDotCom</a> Twitter account.</li>
<li><a href="http://twitter.com/thisisnotapril">April Nassi</a> &#8212; Do the workbook, talk to <a href="http://twitter.com/DCarroll">Dave Carroll</a> and attend <a href="http://developer.force.com/content/type/Webinar">Force.com Fridays and other webinars</a>.</li>
</ul>
<div>And <a href="http://Twitter.com/ReidCarlberg">me</a>?  What&#8217;s my advice?  I have a few.</div>
<div>
<ul>
<li>Get to know the technical docs.  They&#8217;re very good.  The <a href="http://www.salesforce.com/us/developer/docs/apexcode/index.htm">Apex</a>, <a href="http://www.salesforce.com/us/developer/docs/pages/index.htm">Visualforce</a> and <a href="http://www.salesforce.com/us/developer/docs/soql_sosl/index.htm">SOQL</a> references are the ones I visit the most.</li>
<li>You can find a complete <a href="http://www.salesforce.com/us/developer/docs/api/Content/data_model.htm">standard object data model</a> in the SOAP API docs.  (<a href="http://www.salesforce.com/us/developer/docs/api_rest/index.htm">REST API</a> docs are great too!)</li>
<li>Explore the <a href="http://www.youtube.com/dreamforce">Dreamforce</a> and <a href="http://www.youtube.com/developerforce">Developerforce</a> YouTube channels.  There&#8217;s a lot of great content available.</li>
<li>Like everyone else said: do the <a href="http://www.salesforce.com/us/developer/docs/workbook/index.htm">intro workbook</a>.  It&#8217;s worth your time.</li>
<li>Stop in to the <a href="http://blogs.developerforce.com/developer-relations/2011/01/back-to-the-old-skool-with-the-salesforce-irc-channel.html">Salesforce IRC Channel</a> for a little old school chit chat.</li>
</ul>
</div>
<p>Questions? Comments? More advice on how to get started?  Post below or <a href="http://twitter.com/ReidCarlberg">@ReidCarlberg</a>.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/2dsDElAlXQA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/developer-relations/2013/06/advice-for-developers-new-to-the-salesforce-platform.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/developer-relations/2013/06/advice-for-developers-new-to-the-salesforce-platform.html</feedburner:origLink></item>
		<item>
		<title>Discipline: The Secret to InsideSales.com’s Sponsor Success</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/Qlwg-eXWlHg/discipline-the-secret-to-insidesales-coms-sponsor-success.html</link>
		<comments>http://blogs.developerforce.com/isv/2013/06/discipline-the-secret-to-insidesales-coms-sponsor-success.html#comments</comments>
		<pubDate>Wed, 19 Jun 2013 16:42:19 +0000</pubDate>
		<dc:creator>Becky de Loryn</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ISV]]></category>
		<category><![CDATA[salesforce platform]]></category>

		<guid isPermaLink="false">http://30.4494</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/isv/2013/06/discipline-the-secret-to-insidesales-coms-sponsor-success.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/isv/files/2013/06/InsideSales-150x150.jpg" class="alignleft wp-post-image tfe" alt="" title="InsideSales" /></a>Over the last several weeks we had the great pleasure of working with Ken Krogue and Thomas Oldroyd at InsideSales.com on our third Sponsor Success Webinar, Campaign Planning is Key. We learned how a very disciplined approach to event marketing lead to over 1057 live meetings at Dreamforce '12.  ]]></description>
			<content:encoded><![CDATA[<p dir="ltr"><a class="overlay" href="http://blogs.developerforce.com/isv/files/2013/06/InsideSales.jpg"><img class="alignleft size-thumbnail wp-image-4513" title="InsideSales" src="http://blogs.developerforce.com/isv/files/2013/06/InsideSales-150x150.jpg" alt="" width="150" height="150" /></a>Discipline. That’s the InsideSales.com Secret to Sponsor Success</p>
<p dir="ltr">Over the last several weeks we’ve had the great pleasure of working with Ken Krogue and Thomas Oldroyd at InsideSales.com on our third Sponsor Success Webinar, <a href="http://bit.ly/12cF3oV">Campaign Planning is Key</a> (click to listen to the recording).</p>
<p dir="ltr">I’ve been pretty fascinated with their smart marketing moves since I encountered their crew filming customer stories onsite at Dreamforce ‘12 and getting customer feedback while they’re at an event (when they’re already there and charged with Dreamforce energy). That&#8217;s SO SMART. And incredibly efficient.</p>
<p dir="ltr">When I came across <a href="http://www.forbes.com/sites/kenkrogue/2013/04/05/the-12-commandments-of-incredibly-successful-tradeshows/">Ken’s Forbes blog about Tradeshow Secrets</a>, I knew we had to dig deeper into their story as part of our efforts to help partners succeed as sponsors. What got me? They had 1,057 meetings onsite and 5X ROI before they even stepped on the floor.</p>
<p dir="ltr">What we discovered was incredible discipline that everyone should emulate in one way or another. If you plan to spend a dime on an event sponsorship, or even plan to attend an event, take 30-minutes to listen to <a href="http://bit.ly/12cF3oV">Ken’s insights</a>.</p>
<p dir="ltr">One of my next blog posts will be an interview with Jay Baer, the author of “<a href="http://bit.ly/17TBKoW">Youtility, Why Smart Marketing is About Help, Not Hype</a>.” He’s going to help us think about Youtility as it applies to event participation. If it’s possible to personify this concept, Ken and his team do! Just days after we asked him to expand upon the <a href="http://www.forbes.com/sites/kenkrogue/2013/06/10/17-skills-for-highly-effective-tradeshow-events/">17 Skills</a> they train their event teams on, he posted <a href="http://www.forbes.com/sites/kenkrogue/2013/06/10/17-skills-for-highly-effective-tradeshow-events/">another blog</a> on Forbes to share that formula. Thank you Ken and team!</p>
<p>On another note, the InsideSales.com team is trying to break a world record for the <a href="http://bit.ly/11UAsG4">&#8216;Largest Online Seminar&#8217;</a> this week. Can they do it? Looking at the lineup, and knowing this crew, my bet&#8217;s on &#8220;YES”: Guy Kawasaki, Jeff Gitomer and other top sales experts and authors, and business leaders from many of the most successful companies in the <a href="http://salesforce.com/">salesforce.com</a> ecosystem. <a href="http://bit.ly/11UAsG4">Check it out &#8211;June 20th 8AM-3PM pacific</a>.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/Qlwg-eXWlHg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/isv/2013/06/discipline-the-secret-to-insidesales-coms-sponsor-success.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/isv/2013/06/discipline-the-secret-to-insidesales-coms-sponsor-success.html</feedburner:origLink></item>
		<item>
		<title>Finding the Right Salesforce Pagination Tool for Your Force.com Applications</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/5LF-7m__3Wc/finding-the-right-salesforce-pagination-tool-for-your-force-com-applications.html</link>
		<comments>http://blogs.developerforce.com/engineering/2013/06/finding-the-right-salesforce-pagination-tool-for-your-force-com-applications.html#comments</comments>
		<pubDate>Wed, 19 Jun 2013 12:00:43 +0000</pubDate>
		<dc:creator>Alex Dimitropoulos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://25.7830</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/engineering/2013/06/finding-the-right-salesforce-pagination-tool-for-your-force-com-applications.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/engineering/files/2013/06/knowledge2-300x219.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>If you’re a developer building applications on the Force.com platform, you might be considering using pagination to improve your page response time and your users’ overall experience.

And just as those users might prefer to have data sets in straightforward, well-defined chunks so that they can find particular results, you might prefer reading through straightforward, well-defined criteria so that you can choose the best pagination tool. The "Paginating Data for Force.com Applications" article outlines that criteria.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-7834" src="http://blogs.developerforce.com/engineering/files/2013/06/knowledge2-300x219.png" alt="" width="134" height="98" />If you’re a developer building applications on the Force.com platform, you might be considering using pagination to improve your page response time and your users’ overall experience.</p>
<p>And just as those users might prefer to have data sets in straightforward, well-defined chunks so that they can find particular results, you might prefer reading through straightforward, well-defined criteria so that you can choose the best pagination tool.</p>
<h1>The Salesforce Pagination Tools</h1>
<p>Fortunately, Salesforce offers several pagination tools—the query and queryMore API calls, the StandardSetController, and the OFFSET clause—and each of these tools is suited to its own use cases.</p>
<p>In <a href="https://twitter.com/sfdcsregan">Sean Regan</a>&#8216;s newest article, <a href="http://wiki.developerforce.com/page/Paginating_Data_for_Force.com_Applications">Paginating Data for Force.com Applications</a>, you can find:</p>
<ul>
<li>What those use cases are and how they might relate to your own project(s)</li>
<li>The benefits and drawbacks of each tool</li>
<li>Code examples showing what the tools look like in action</li>
<li>“Under the hood” explanations of how the tools work</li>
<li>Common pagination misconceptions</li>
</ul>
<h1>The Technical Enablement Message</h1>
<p dir="ltr">Whether you’re deciding which pagination tool to use or how to configure your sharing architecture, one key Technical Enablement message remains the same: To make the most appropriate and well-informed architectural decisions, it’s important to understand the Salesforce concepts and mechanisms supporting both what is and what isn’t seen by your users. Getting a fuller Salesforce picture makes you a more well-rounded Salesforce architect.</p>
<p>As this new article explains, the &#8220;best&#8221; pagination tool depends on several considerations, including whether your users typically move past the first page of results. If you read this article, and visit or revisit the following related resources, you can improve both how you and your pages perform for your organization and its users.</p>
<h1>Related Resources</h1>
<ul>
<li><a href="http://wiki.developerforce.com/page/Paginating_Data_for_Force.com_Applications">Paginating Data for Force.com Applications</a></li>
<li><a href="http://wiki.developerforce.com/page/Webinar:_Inside_the_Force.com_Query_Optimizer_(2013-Apr)">Inside the Force.com Query Optimizer</a></li>
<li><a href="http://s3.amazonaws.com/dfc-wiki/en/images/0/0e/Db-query-search-optimization-cheat-sheet.pdf">Database Query &amp; Search Optimization Cheat Sheet</a></li>
<li><a href="http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes">Best Practices for Deployments with Large Data Volumes</a></li>
<li><a href="http://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm">Working with Very Large SOQL Queries</a></li>
<li><a href="http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf">Force.com Apex Code Developer’s Guide</a></li>
<li><a href="http://blogs.developerforce.com/engineering/2013/03/long-and-short-term-approaches-for-tuning-force-com-performance.html">Long- and Short-Term Approaches for Tuning Force.com Performance</a></li>
<li><a href="http://developer.force.com/architect">Architect Core Resources</a></li>
</ul>
<h1>About the Author and CCE Technical Enablement</h1>
<p><a href="https://twitter.com/adimitrop">Alex Dimitropoulos</a> is an associate technical writer dedicated to the Technical Enablement team of the salesforce.com Customer-Centric Engineering group. The team’s mission is to help customers understand how to implement technically sound salesforce.com solutions. Check out all of the resources that this team maintains on the<a href="http://developer.force.com/architect"> Architect Core Resources</a> page of Developer Force.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/5LF-7m__3Wc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/engineering/2013/06/finding-the-right-salesforce-pagination-tool-for-your-force-com-applications.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/engineering/2013/06/finding-the-right-salesforce-pagination-tool-for-your-force-com-applications.html</feedburner:origLink></item>
		<item>
		<title>Dreamforce 2013 Developer Call for Papers Closed</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/W0hf1DiapFg/dreamforce-2013-developer-call-for-papers-closed.html</link>
		<comments>http://blogs.developerforce.com/developer-relations/2013/06/dreamforce-2013-developer-call-for-papers-closed.html#comments</comments>
		<pubDate>Tue, 18 Jun 2013 17:05:39 +0000</pubDate>
		<dc:creator>April Nassi</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dreamforce]]></category>

		<guid isPermaLink="false">http://26.14486</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/developer-relations/2013/06/dreamforce-2013-developer-call-for-papers-closed.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/developer-relations/files/2013/06/403_dev_2013_cfp-150x150.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>WOW! We had an amazing response to our Call for Papers this year, with over 250 submissions from our developer community! Thank you to all who submitted; it's wonderful seeing the excitement for sharing knowledge and code. We'll be reviewing submissi]]></description>
			<content:encoded><![CDATA[WOW! We had an amazing response to our Call for Papers this year, with over 250 submissions from our developer community! Thank you to all who submitted; it's wonderful seeing the excitement for sharing knowledge and code. We'll be reviewing submissi<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/W0hf1DiapFg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/developer-relations/2013/06/dreamforce-2013-developer-call-for-papers-closed.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/developer-relations/2013/06/dreamforce-2013-developer-call-for-papers-closed.html</feedburner:origLink></item>
		<item>
		<title>Passing Objects to Future Annotated Methods</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/duLaRXDLDW8/passing-objects-to-future-annotated-methods.html</link>
		<comments>http://blogs.developerforce.com/developer-relations/2013/06/passing-objects-to-future-annotated-methods.html#comments</comments>
		<pubDate>Mon, 17 Jun 2013 22:49:02 +0000</pubDate>
		<dc:creator>Quinton Wall</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[quinton wall]]></category>

		<guid isPermaLink="false">http://26.14460</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/developer-relations/2013/06/passing-objects-to-future-annotated-methods.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/developer-relations/files/2013/06/olympics-sat-async2-485-300x254.jpg" class="alignleft wp-post-image tfe" alt="" title="" /></a>The future annotation is a great feature in the Salesforce Platform. However, it only supports primitives for argument methods. Using the JSON serialize&#124;deserialize methods, you can easily pass sObjects and custom objects. Here's how.]]></description>
			<content:encoded><![CDATA[<p><a class="overlay" href="http://blogs.developerforce.com/developer-relations/files/2013/06/olympics-sat-async2-485.jpg"><img class="alignright size-medium wp-image-14466" src="http://blogs.developerforce.com/developer-relations/files/2013/06/olympics-sat-async2-485-300x254.jpg" alt="" width="180" height="152" /></a>The future annotation is a great feature on the Salesforce Platform to allow you to execute custom logic asynchronously. I often use them to perform callouts within the context of a database trigger.  However, one of the restrictions of future annotations is that you can not pass sObjects or objects as arguments to the annotated method. I regularly use encapsulation to pass a collection of parameters, or even an sObject, but this won&#8217;t work in @future method:</p>
<p>&nbsp;</p>
<pre>@future
static void doFutureCall(List&lt;AddressHelper&gt; addresses) {
  //do something
}</pre>
<p>But thankfully there is a way you can do. The secret sauce is the JSON serialize|deserialize methods.</p>
<p>Take the example of an AddressHelper object referred to above. This is encapsulated convenience object to help me pass around address details. (note:For simplicity, this helper object just includes strings, but it could easily include other types including objects, sobjects, collections etc.)</p>
<pre>/**
 * Sample encapsulated class
 * $author: qwall@salesforce.com
 */
public with sharing class AddressHelper {

	public String street {set; get;}
	public String city {set; get;}
	public String state {set; get;}
	public String zip {set; get;}

    public AddressHelper(String s, String c, String st, String z) {
    	street = s;
    	city = c;
    	state = st;
    	zip = z;
    }
}</pre>
<p>Using the JSON serialize method I can easily pass this to an @future method.</p>
<pre>public with sharing class AddressFuture {</pre>
<pre>    public AddressFuture () {

	List&lt;String&gt; addresses = new List&lt;String&gt;();
	AddressHelper ah1 = new AddressHelper('1 here st', 'San Francisco', 'CA', '94105');
	AddressHelper ah2 = new AddressHelper('2 here st', 'San Francisco', 'CA', '94105');
	AddressHelper ah3 = new AddressHelper('3 here st', 'San Francisco', 'CA', '94105');

	//serialize my objects
	addresses.add(JSON.serialize(ah3));
	addresses.add(JSON.serialize(ah2));
	addresses.add(JSON.serialize(ah3));

	doFutureCall(addresses);

  }</pre>
<p>And then, within my future method, all I need to do is deserialize the object, and you are good to go.</p>
<pre>  @future
    static void doFutureCall(List&lt;String&gt; addressesSer) {

    	AddressHelper currAddress = null;

       for (String ser : addressesSer)
       {

       	 currAddress = (AddressHelper) JSON.deserialize(ser, AddressHelper.class);
       	 System.debug('Deserialized in future:'+currAddress.street);
       }
    }</pre>
<p>That&#8217;s it. JSON.serialize|deserialize makes it amazingly simple to pass objects, even ones with complex nested relationships, to @future annotated methods. There are time though that a particular object can not be serialized due to the underlying inheritance structure. One such example is the Pattern class in Apex.</p>
<p>To handle these outliers, I often create my own custom getSerializable() method on my custom object. For example, I use this strategy within the Chatter Blacklist app to pass a patternHelper object to an @future method.</p>
<pre>/**
     * return a serializable version of the patternhelper
     */
    public PatternHelperSerializable getSerializable()
    {
    	//instead of passing the Pattern object, let's just pass the regex string from
        //via Pattern.pattern() method
    	return new PatternHelperSerializable(blacklistedWord, p.pattern(), origPostBody, postCreatedById);
    }</pre>
<pre></pre>
<p>That&#8217;s about it. You can grab the complete code for the examples above as a gist <a href="https://gist.github.com/quintonwall/5798506" target="_blank">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/duLaRXDLDW8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/developer-relations/2013/06/passing-objects-to-future-annotated-methods.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/developer-relations/2013/06/passing-objects-to-future-annotated-methods.html</feedburner:origLink></item>
		<item>
		<title>Site.com Timesavers: Reusable Custom Widgets</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/iWZ5jq3cgks/site-com-timesavers-reusable-custom-widgets.html</link>
		<comments>http://blogs.developerforce.com/tech-pubs/2013/06/site-com-timesavers-reusable-custom-widgets.html#comments</comments>
		<pubDate>Mon, 17 Jun 2013 09:00:39 +0000</pubDate>
		<dc:creator>Caragh Smyth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Site.com]]></category>
		<category><![CDATA[summer '13]]></category>
		<category><![CDATA[time savers]]></category>
		<category><![CDATA[websites]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://28.5753</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/tech-pubs/2013/06/site-com-timesavers-reusable-custom-widgets.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/time-money.png" class="alignleft wp-post-image tfe" alt="Time equals money" title="" /></a>The new widgets feature in Site.com, available in Summer ’13, uses a build-once-then-reuse approach to save you time when building your website. By combining existing Site.com page elements, such as panels, content blocks, custom code, and data repeaters, you can build widgets—in essence, your own custom page elements—to suit your unique requirements. And just like any other page element, you can reuse custom widgets on any site page or page template in your site.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify"><img class="alignright size-full wp-image-6083" style="margin: 0px 20px" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/time-money.png" alt="Time equals money" width="178" height="77" />Site.com is <em>all</em> about building once, then reusing. Whether you’re building a page template to base site pages on, or creating a cascading style sheet (CSS) to centralize control of your site’s appearance, you create the item once and then reuse it throughout the site. This fundamental build-once-then-reuse approach saves you time.</p>
<p>The new widgets feature, available in Summer ’13, takes advantage of the same time-saving model. By combining existing Site.com page elements, such as panels, content blocks, custom code, and data repeaters, you can build widgets—in essence, your own custom page elements—to suit your unique requirements. And just like any other page element, you can reuse custom widgets on any site page or page template in your site.</p>
<p>In addition, when you edit the widget, your changes are reflected immediately on every page that references it. So one quick modification, such as changing the widget&#8217;s background color, could update tens of pages in your site. (Just imagine if you had to edit every…single…page!)</p>
<p>When you open a site in Site.com Studio, you&#8217;ll notice we’ve added a new Widgets view to the Overview tab, where you can add and manage your site’s widgets.</p>
<p><img class="alignnone size-full wp-image-5801" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/sitecom_widgets.png" alt="Widgets view on the Overview tab in Site.com Studio" width="795" height="333" /><br />
When you create a widget, it’s also added to the Page Elements pane, where you and your team can easily drag it onto the page.</p>
<p><img class="alignnone size-full wp-image-5805" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/widget-page-elements.png" alt="Widgets section in the Page Elements pane" width="248" height="277" /></p>
<h1>Real-World Example: Creating a Twitter Follow Button Widget</h1>
<p>Let&#8217;s look at a real-world example by creating a Twitter Follow Button widget that allows users to follow a Twitter account easily from any page in your site.</p>
<p>First, import a 16&#215;16 pixel icon that will represent the widget in the Page Elements pane—for example, <a class="overlay" href="http://blogs.developerforce.com/tech-pubs/files/2013/05/twittericon.png"><img class="alignnone size-full wp-image-5879" style="margin: 0px" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/twittericon.png" alt="Twitter icon" width="16" height="16" /></a>.</p>
<p>Then, in the Widgets view on the Overview tab, click <strong>New Widget</strong> and enter a name. Also add a description and select the imported Twitter icon.</p>
<p>The widget isn&#8217;t ready to use just yet, so deselect <strong>Available in the Page Elements pane</strong> and save the changes.</p>
<p><img class="alignnone size-full wp-image-5880" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/create-widget.png" alt="Create a Widget dialog box" width="457" height="359" /><br />
That&#8217;s the first step to creating a widget, but it doesn&#8217;t yet contain any content or page elements, so click the widget to open it in a new tab. Your work area is the same whether you&#8217;re building pages or widgets, so the usual Page Elements pane, Properties pane, and so on are available on either side of the canvas.</p>
<p>Drag a <strong>Custom Code</strong> page element from the Page Elements pane onto the canvas, and paste the following code into the dialog box:</p>
<pre>&lt;a href="https://twitter.com/twitterapi" class="twitter-follow-button" data-show-count="false" data-lang="en"&gt;Follow @twitterapi&lt;/a&gt;</pre>
<p>This code creates the button when the page loads, so to specify which user profile to follow, replace <em>twitterapi</em> in the URL with the profile you want to link to—for example, https://twitter.com/bitswest.</p>
<p>Now you need to include Twitter&#8217;s JavaScript library, so click <strong>Configure</strong> in the Edit Head Markup section of the Properties pane.</p>
<p><img class="alignnone size-full wp-image-6006" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/script1.png" alt="The Configure scripts button in the Properties pane" width="222" height="223" /><br />
Paste the following JavaScript into the dialog box:</p>
<pre>&lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt;</pre>
<p>And that&#8217;s it—you&#8217;ve built a simple Twitter widget! To test the widget, preview it and click the button to ensure it links to the Twitter profile page you specified.</p>
<p><img style="margin: 0px" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/follow-button.png" alt="Follow" width="123" height="20" /></p>
<p>The final step is to make the widget available for use, so in the Properties pane, select <strong>Available in the Page Elements pane</strong>.</p>
<p>Now you and your team can use the widget on any site page or page template in your site. You can even use it to create other widgets, such as a page header widget that contains your company logo and the Twitter widget. How you decide to combine page elements, custom code, CSS, or other widgets to create new widgets is entirely up to you!</p>
<h1>Top Tips for Working with Widgets</h1>
<ul>
<li>Wherever possible, use widgets to reduce duplication in your site design. This is particularly important when working with complex designs or site elements, where maintenance can be time consuming.</li>
<li>Use widgets to store commonly used pieces of text, such as company names, addresses, legal text, and so on. Simply create a widget that contains a content block with the relevant text.</li>
<li>When using CSS to style widgets, add the styles to the Site Style Sheet, which is the site’s global style sheet. Because every page automatically references the style sheet, you can ensure each widget will appear correctly on the page.</li>
<li>If you plan to use the same widgets across several sites, consider creating a basic site to contain all the required widgets. Then, for each new site you need, just create a copy of that site. That way, each new site automatically includes all of the widgets you created.</li>
</ul>
<h1>Related Resources</h1>
<ul>
<li>For more information about widgets, see &#8220;<a title="Widgets Overview" href="https://help.salesforce.com/apex/HTViewHelpDoc?id=siteforce_widget_overview.htm&amp;language=en_US" target="_blank">Widgets Overview</a>&#8221; in the online help, and check out the <a title="Salesforce Summer '13 Release Notes" href="https://na1.salesforce.com/help/doc/en/salesforce_summer13_release_notes.pdf" target="_blank">Salesforce Summer &#8217;13 Release Notes</a>.</li>
<li>For information about customizing the Twitter Follow Button widget further, check out the <a title="Configuring the Follow Button" href="https://dev.twitter.com/docs/follow-button#configure-your-follow-button" target="_blank">Twitter Developer documentation</a>.</li>
</ul>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/iWZ5jq3cgks" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/tech-pubs/2013/06/site-com-timesavers-reusable-custom-widgets.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/tech-pubs/2013/06/site-com-timesavers-reusable-custom-widgets.html</feedburner:origLink></item>
		<item>
		<title>5 Ways to Make Your Mobile Apps Faster with the Connect API</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/c05_ZU7F7_k/5-ways-to-make-your-mobile-apps-faster-with-the-connect-api.html</link>
		<comments>http://blogs.developerforce.com/engineering/2013/06/5-ways-to-make-your-mobile-apps-faster-with-the-connect-api.html#comments</comments>
		<pubDate>Thu, 13 Jun 2013 18:12:22 +0000</pubDate>
		<dc:creator>alouie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chatter]]></category>
		<category><![CDATA[connect]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://25.7666</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/engineering/2013/06/5-ways-to-make-your-mobile-apps-faster-with-the-connect-api.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/engineering/files/2013/05/images-150x150.jpg" class="alignleft wp-post-image tfe" alt="" title="images" /></a>The Salesforce.com mobile apps are powered by the same public APIs that developers use. Find out about some of the innovative features we've added to the Connect API to help us—and you—develop faster mobile apps.]]></description>
			<content:encoded><![CDATA[<p><a class="overlay" href="http://blogs.developerforce.com/engineering/files/2013/05/images.jpeg"><img class="alignleft size-thumbnail wp-image-7824" title="images" src="http://blogs.developerforce.com/engineering/files/2013/05/images-150x150.jpg" alt="" width="150" height="150" /></a>At Salesforce.com, we love our mobile apps and strive to bring you the best possible user experience on them. A big part of great user experience is responsiveness—nobody wants a sluggish app. We&#8217;ve learned that using an API designed for mobile consumption is essential when dealing with the reality of high latency in mobile networks and low processing power in mobile devices (particularly older ones). In this article, we&#8217;d like to highlight some of the mobile-friendly features that we&#8217;ve built into the public <a href="http://wiki.developerforce.com/page/Chatter_API">Connect API</a>, which is used by our <a href="http://www.salesforce.com/mobile/apps/chatter/">Chatter Mobile</a> apps and countless third-party web, desktop, and mobile applications.</p>
<h1>Simple and Complete Responses</h1>
<p>The Connect API is a presentation layer REST API. When you issue a request, what comes back is a representation that’s easy to consume when you’re building a UI. For example, if you want to display a user’s Chatter news feed in your app, it only takes a single call to the <a href="http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resource_feeds_news.htm">/chatter/feeds/news/me</a> endpoint to get everything you need to render a page—it returns the feed items, comments, likes, information about the users, and much more. Minimizing the number of network round trips is essential for mobile app performance. The more complete the representation is, the fewer round trips you need to make.</p>
<h1>Property filtering</h1>
<p>There’s a tradeoff in providing so much information in a response. If some of the data isn’t needed, it’s overhead: it consumes bandwidth and processing power. To address this, we introduced the ability to <a href="http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_returns_filters.htm">filter response bodies</a> in v27.0 of the Connect API. This feature allows you to specify exactly which properties you require in the representation. For example, if you only want to include the bodies of feed items within a feed, you can make this request for a compact response:</p>
<pre>GET /chatter/feeds/news/me/feed-items?include=/items/feedItem/body</pre>
<p>You can also specify properties to exclude. For example, if you have no need for the clientInfo property of a feed item, you can exclude it from the response with:</p>
<pre>GET /chatter/feeds/news/me/feed-items?exclude=/items/feedItem/clientInfo</pre>
<p>These examples filter a single property, but you can also filter multiple properties.</p>
<h1>Generic batching</h1>
<p>It’s not always possible for us to provide everything you need to build a UI screen in a single API call. In v28.0 of the Connect API, we introduced a new endpoint, <a href="http://www.salesforce.com/us/developer/docs/chatterapi/Content/connect_resources_batch.htm">/connect/batch</a>, that allows you to combine multiple subrequests into a single request. Our mobile development team loves using this feature to minimize the number of round trips their apps require.</p>
<p>Taking an example from our API documentation, here’s how to like a Chatter feed item (the first subrequest) and then get the total number of likes on that feed item. Notice that the second subrequest uses an inclusion filter to get only the data it needs, as described above.</p>
<pre>POST /connect/batch</pre>
<p>With a JSON request body:</p>
<pre>{
  "batchRequests" : [
   {
      "method" : "Post",
      "url" : "/v28.0/chatter/feed-items/feedItemId/likes"
   },
   {
      "method" : "Get",
      "url" : "/v28.0/chatter/feed-items/feedItemId?include=/likes/total"
   }
  ],
  "haltOnError" : "false"
}</pre>
<h1>Batching for specific object types</h1>
<p>The Connect API also offers optimized batch endpoints for files, group memberships, groups, motifs, and users. They allow you to specify a list of IDs and get information about them in one call—the data is “bulk loaded”, which means that it’s retrieved optimally from the database. Bulk loading is much faster than issuing individual calls for each ID, even if they’re done in a generic batch. Here’s an example that shows how to get information about three Chatter groups:</p>
<pre>GET /chatter/groups/batch/0F9B000000000W2,0F9B000000005Px,0F9B000000006Tu</pre>
<h1>Paged Collections</h1>
<p>Many of our endpoints can return a very large amount of data that a client doesn&#8217;t need. Examples include getting a user&#8217;s news feed and querying for information about the Chatter groups in an organization. Rather than returning everything, we return paged data and use opaque tokens for going to the next page and the previous page. Clients can specify the page size for greater flexibility, and we&#8217;ve chosen reasonable defaults such as 25 feed items per page.</p>
<h1>Try the Connect API</h1>
<p>These are some of the ways the Connect API team is enabling mobile app developers to improve the responsiveness of their apps, and we’re working on many more! Remember that even though these features are particularly well-suited for mobile apps, they’re generally applicable and have benefits for traditional web and desktop apps too. Everybody loves a performance gain.</p>
<p>To get started with the Connect API, see the <a href="http://wiki.developerforce.com/page/Chatter_API">landing page</a> on Developer Force and the <a href="http://www.salesforce.com/us/developer/docs/chatterapi/index.htm">API documentation</a>.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/c05_ZU7F7_k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/engineering/2013/06/5-ways-to-make-your-mobile-apps-faster-with-the-connect-api.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/engineering/2013/06/5-ways-to-make-your-mobile-apps-faster-with-the-connect-api.html</feedburner:origLink></item>
		<item>
		<title>Congratulations, Apple!</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/50LTXy6l0xE/congratulations-apple.html</link>
		<comments>http://blogs.developerforce.com/developer-relations/2013/06/congratulations-apple.html#comments</comments>
		<pubDate>Wed, 12 Jun 2013 21:54:54 +0000</pubDate>
		<dc:creator>Adam Seligman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[salesforce]]></category>

		<guid isPermaLink="false">http://26.14452</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/developer-relations/2013/06/congratulations-apple.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/developer-relations/files/2013/06/ios7_01-300x260.jpg" class="alignleft wp-post-image tfe" alt="" title="" /></a>At WWDC this week, Apple announced that they have paid out over $10B to developers. Congratulations, Apple! We love developers, and the app revolution. We are seeing the same incredible momentum and need for mobile apps in the enterprise. ]]></description>
			<content:encoded><![CDATA[<p dir="ltr"><a href="http://blogs.developerforce.com/developer-relations/files/2013/06/ios7_01.jpg"><img class="alignright" src="http://blogs.developerforce.com/developer-relations/files/2013/06/ios7_01-300x260.jpg" alt="" width="162" height="140" /></a>It&#8217;s an exciting time for developers.  iOS7 is catalyzing the next generation of gorgeous apps for work and play.  Devices from Apple will drive a new wave of innovation and be used in every facet of our personal and professional lives.  Developers have written more than 900K apps for the Apple App Store, and developers have earned a total of $10B dollars over the years.</p>
<p dir="ltr">There&#8217;s another huge milestone Apple has passed: apps in the Apple App Store now average more than $10K total revenue per app.  There is of course a distribution with some runaway hits and a long tail. An expected payout of $10K, and an exciting blowout head of multi-million dollar apps will inspire many long nights of developers hacking to build the next big thing.</p>
<p dir="ltr"><a href="http://blogs.developerforce.com/developer-relations/files/2013/06/mobile-zimmer.png"><img class="alignleft" src="http://blogs.developerforce.com/developer-relations/files/2013/06/mobile-zimmer-300x234.png" alt="" width="240" height="187" /></a>We love the app revolution, and we are convinced it&#8217;s already hit the enterprise as well.  <a href="http://salesforce.com/" target="_blank">Salesforce.com</a> has built the leading business apps marketplace with the AppExchange, touting more than 1800 apps for business to date.  We don&#8217;t do Angry Birds. But we do know that enterprises want social, mobile and connected apps and they are willing to pay for them.  The average developer on the AppExchange makes $392,000 per app.  That&#8217;s right, almost $400K from companies including 70% of the Fortune 100. And what&#8217;s great about selling these next generation apps to businesses is that a single install in our world can sometimes account for tens of thousands of users!</p>
<p>We are embracing the enterprise app revolution, and we love developers. That&#8217;s why we&#8217;ve paid more than $750M to developers since we launched the AppExchange.  And it&#8217;s accelerating.  If you want to be part of this revolution, you can <a href="http://developerforce.com/mobile" target="_blank">start today for free</a>.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/50LTXy6l0xE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/developer-relations/2013/06/congratulations-apple.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/developer-relations/2013/06/congratulations-apple.html</feedburner:origLink></item>
		<item>
		<title>Extracting Large Data Volumes (LDV) in Force.com</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/2WVtU5T4uFc/extracting-large-data-volume-ldv-in-force-com.html</link>
		<comments>http://blogs.developerforce.com/engineering/2013/06/extracting-large-data-volume-ldv-in-force-com.html#comments</comments>
		<pubDate>Wed, 12 Jun 2013 12:00:47 +0000</pubDate>
		<dc:creator>Daisuke Kawamoto</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[LDV]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://25.7736</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/engineering/2013/06/extracting-large-data-volume-ldv-in-force-com.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/engineering/files/2013/06/binary_code-150x150.jpg" class="alignleft wp-post-image tfe" alt="" title="" /></a>You’ve been tasked with extracting data from a Salesforce object. If you’re dealing with small volumes of data, this operation might be simple, involving only a few button clicks using some of the great tools available on the AppExchange.

But when it comes to dealing with millions of records in a limited time frame, you might need to take extra steps to optimize the data throughput. Read this post to learn just what those steps are.]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-7748" src="http://blogs.developerforce.com/engineering/files/2013/06/binary_code-150x150.jpg" alt="" width="120" height="120" />You’ve been tasked with extracting data from a Salesforce object. If you’re dealing with small volumes of data, this operation might be simple, involving only a few button clicks using some of the great tools available on the <a href="https://appexchange.salesforce.com/results?filter=a0L3000000OvSOsEAN">AppExchange</a>.</p>
<p>But when it comes to dealing with millions of records in a limited time frame, you might need to take extra steps to optimize the data throughput.</p>
<h1>Optimizing Data Extraction in Force.com</h1>
<p>Here’s a common scenario: Your business analysis team is architecting an external business intelligence (BI) system, and you want both to integrate data from your Salesforce organization into this new system and to run a daily integration. Although you have built application logic to extract only the deltas (i.e., newly inserted or updated records since the last extraction), you still have hundreds of thousands of records you need to extract from tens of millions of records in your Salesforce object. You also have a limited window in which you can complete this task as a nightly batch job, and you can&#8217;t use the weekly export service because you need to extract the data more than once per week.</p>
<p>Trying to get everything out from a large object in a single transaction is a problem because the query takes too long and, in most cases, times out. We recommend both architecting data extractions to retrieve only the delta (i.e., updated, newly inserted, and deleted) rows and updating those rows in the external system. However, if the number of records you need to extract is still in the millions, the first step in resolving this issue is to split or &#8220;chunk&#8221; the transaction into smaller pieces so that each request does not time out. After doing that, make each of the smaller requests complete faster, then run the requests in parallel to compress the overall time it takes to extract all of the data.</p>
<h1>Chunking the Data into Smaller Sets</h1>
<p>Using a date range to group data into sets can be easy and clean, but the total number of records that could fall within a given range might go above the Force.com query optimizer’s selectivity threshold. When this happens, the underlying query must do a full object scan, often leading to timeouts. (Refer to the  <a href="http://s3.amazonaws.com/dfc-wiki/en/images/0/0e/Db-query-search-optimization-cheat-sheet.pdf">Database Query and Search Optimization Cheat Sheet</a>to see what the selectivity thresholds are.) If you are certain that filtering by the date range alone will always be selective, you can use this field to chunk your data. Otherwise, using a unique ID is more reliable, and can be easily implemented by following these steps.</p>
<ol>
<li>Create or use an existing auto-number field. Alternatively, you can use any number fields that can make up a unique value, as long as they are sequential.<br />
<strong>Note</strong>: If you are adding a new auto-number field, make sure to enable the &#8220;Generate Auto Number for existing records&#8230;&#8221; option.</li>
<li>Create a formula field that converts the auto-number field text value into a numeric value—you cannot use an index with comparison operators such as &#8220;&lt;=&#8221; (less than or equal to) or &#8220;&gt;&#8221; (greater than) for the text-based auto-number field. In this example, we&#8217;ll name this field &#8220;ExportID.&#8221;</li>
<li>Place a custom index on the formula field by contacting salesforce.com Customer Support.<br />
<strong>Hint</strong>: Depending on the characteristics and distribution of your data, adding another selective filter, such as &#8220;CreatedDate,&#8221; and placing a compound (or two-column) index might help group the data sets in a more meaningful, manageable way.</li>
</ol>
<ol start="4">
<li>Run pre-queries to determine the boundaries. For example:</li>
</ol>
<ul>
<li>To find the lowest boundary:</li>
</ul>
<pre style="padding-left: 30px">Select ExportID__c From YourObject__c order by ExportID__c asc null last limit 1;</pre>
<ul>
<li>To find the highest boundary:</li>
</ul>
<pre style="padding-left: 30px">Select ExportID__c From YourObject__c  order by ExportID__c desc null last limit 1;</pre>
<p style="padding-left: 19px" dir="ltr"><strong>Hint</strong>: Although you should have no records with the &#8220;ExportID__c&#8221; field empty (i.e., null), look for them before running your queries so that you don&#8217;t miss them before the extraction.</p>
<ol start="5">
<li>Add a range filter to your extraction (i.e., a WHERE clause in your SOQL) to limit the number of targeted rows so that they are below the selectivity threshold. For example:</li>
</ol>
<pre style="padding-left: 30px">SELECT Field1__c, Field2__c, [Field3__c …]
FROM Account
WHERE  ExportID__c &gt; 1000000
AND ExportID__c &lt;= 1200000
;</pre>
<p>When submitting the subsequent requests to retrieve the data, simply replace the &#8220;ExportID__c&#8221; values by incrementing the ranges until you have gone through all of your data. Things get a little more complicated if you mass delete records often. While the approach described above still works, the gaps created by deleting records reduces the number of records included in each range, making it less optimal from a performance perspective. In other words, you could have a &#8220;chunk&#8221; that returns only a few or even no rows. There is a solution to this problem, which I will cover in a later Technical Enablement post.</p>
<h1>Increasing Data Throughput</h1>
<p>Increasing data throughput not only shortens the time it takes to retrieve the data, but it also increases the quality of the extracted data at a specific moment in time. For example, by running the extraction during off-peak hours and within a shorter window, you are less likely to have data discrepancy issues, such as having an extracted child record in one of your queries turn into an orphan record because someone deleted its parent record before the subsequent query ran.</p>
<p>Here are some best practices for increasing throughput.</p>
<ul>
<li>Run your requests in parallel.</li>
<li>Have an administrator with access to all the data perform the extraction. This practice can help you minimize sharing calculation overhead.</li>
<li>Always use the Bulk API or batch Apex when dealing with large data volumes.<br />
<strong>Note</strong>: Your requests might not always be returned in the order that you submitted them.</li>
</ul>
<p>If you need an extra boost to increase throughput, consider using a <a href="http://blogs.developerforce.com/engineering/2013/03/long-and-short-term-approaches-for-tuning-force-com-performance.html">skinny table</a>, which can reduce the database table joins and parallel processing that happens under the hood. It can be a good fit if you are extracting a subset of fields (fewer than 100 fields) from the base table, and if those fields&#8217; types are supported by the skinny table. If you decide to use a skinny table, you must first create an Apex trigger to take the auto-number field (or the sequence ID field) and store its value in a static custom field because formula fields cannot be included in skinny tables.</p>
<h1>Additional Data Extraction Considerations</h1>
<ul>
<li>Remember that <a href="http://blogs.developerforce.com/engineering/2013/01/implementing-idempotent-operations-with-salesforce.html">idempotence</a> is an important design consideration in successful extraction processes. Make sure that your job is designed so that resubmitting failed requests fills in the missing records without creating duplicate records for partial extractions.</li>
<li>When testing and measuring the performance of your extraction, beware of the effects of the Force.com platform’s caching. The more tests you run, the more likely that the data extraction will complete faster because of the underlying database cache utilization. While it is great to have better performance, don’t schedule your batch jobs based on the assumption that you will always see the best results.</li>
<li>Be aware of the Force.com governor limits. Follow <a href="http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes">best practices for deployments with large data volumes</a> to reduce the risk of hitting limits when executing jobs and SOQL queries.</li>
</ul>
<h1>Summary</h1>
<p>When extracting large data volumes, consider splitting requests into smaller sets to avoid timeouts and using techniques such as indexed filtering, parallel requests, and skinny tables to maximize data throughput. In addition, when you&#8217;re designing your extraction process, keep idempotence in mind—it&#8217;s a key part of every successful integration implementation.</p>
<h1>Related Resources</h1>
<ul>
<li><a href="http://blogs.developerforce.com/engineering/2013/03/long-and-short-term-approaches-for-tuning-force-com-performance.html">Long- and Short-Term Approaches for Tuning Force.com Performance</a></li>
<li><a href="http://wiki.developerforce.com/page/Best_Practices_for_Deployments_with_Large_Data_Volumes">Best Practices for Deployments with Large Data Volumes</a></li>
<li><a href="http://s3.amazonaws.com/dfc-wiki/en/images/0/0e/Db-query-search-optimization-cheat-sheet.pdf">Database Query and Search Optimization Cheat Sheet</a></li>
<li><a href="http://developer.force.com/architect">Architect Core Resources</a></li>
</ul>
<h1>About the Author</h1>
<p><a href="https://twitter.com/DaisukeSfdc">Daisuke Kawamoto</a> is an Architect Evangelist within the Technical Enablement team of the salesforce.com Customer-Centric Engineering group. The team’s mission is to help customers understand how to implement technically sound salesforce.com solutions. Check out all of the resources that this team maintains on the<a href="http://developer.force.com/architect"> Architect Core Resources</a> page of Developer Force.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/2WVtU5T4uFc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/engineering/2013/06/extracting-large-data-volume-ldv-in-force-com.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/engineering/2013/06/extracting-large-data-volume-ldv-in-force-com.html</feedburner:origLink></item>
		<item>
		<title>Refreshing Visualforce Charts with Updated Data</title>
		<link>http://feedproxy.google.com/~r/SforceBlog/~3/V7J5wvxCHLA/updating-visualforce-chart-data.html</link>
		<comments>http://blogs.developerforce.com/tech-pubs/2013/06/updating-visualforce-chart-data.html#comments</comments>
		<pubDate>Tue, 11 Jun 2013 17:40:56 +0000</pubDate>
		<dc:creator>Michael Alderete</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[charting]]></category>
		<category><![CDATA[javascript remoting]]></category>
		<category><![CDATA[visualforce]]></category>

		<guid isPermaLink="false">http://28.5697</guid>
		<description><![CDATA[<a href="http://blogs.developerforce.com/tech-pubs/2013/06/updating-visualforce-chart-data.html"><img align="left" hspace="5" width="150" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/visualforce-charting-updating-data-ui-300x192.png" class="alignleft wp-post-image tfe" alt="Visualforce Pie Chart" title="" /></a>Visualforce charting is one of the most popular features added to Visualforce while I've been writing documentation for the product, and JavaScript Remoting is one of the most powerful. Perhaps you've wondered how to combine the two. This article shows you how, with a complete source code sample that compares "traditional" Visualforce charting with the same chart implemented using JavaScript Remoting.]]></description>
			<content:encoded><![CDATA[<p>Visualforce charting is one of the most popular features added to Visualforce while I&#8217;ve been writing documentation for the product, and JavaScript Remoting is one of the most powerful. Perhaps you&#8217;ve wondered how to combine the two.</p>
<p><a class="overlay" href="http://blogs.developerforce.com/tech-pubs/files/2013/05/visualforce-charting-updating-data-ui.png"><img class="alignright size-medium wp-image-5703" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/visualforce-charting-updating-data-ui-300x192.png" alt="Visualforce Pie Chart" width="300" height="192" /></a>This sample shows how to load and update a chart using two different methods, highlighting how to use JavaScript Remoting to smoothly load new data and update the chart. The example chart is a simple pie chart, and updates happen when the user selects a new year to display from a menu.</p>
<p>&#8220;Traditional&#8221; Visualforce loads the chart data using an expression to call a controller method, and updates the data using an <code>&lt;apex:actionSupport&gt;</code> component to re-render the chart&#8217;s section of the page in response to choosing a different year. The technique is well explained in the Visualforce Developer&#8217;s Guide.</p>
<p>The JavaScript Remoting version relies on some JavaScript code that I&#8217;ve written myself, instead of the automatic behaviors built into Visualforce. It&#8217;s a bit more code, but it&#8217;s also more flexible, with a smoother transition when the chart is updated. The following sample is more comprehensive than any currently in the Visualforce documentation.</p>
<p>To start with, here&#8217;s the controller code, a straightforward expansion of a pie chart controller from the Visualforce Developer&#8217;s Guide:</p>
<pre>public class PieChartRemoteController {

    // The year to be charted
    public String chartYear {
        get {
            if (chartYear == null) chartYear = '2013';
            return chartYear;
        }
        set;
    }

    // Years available to be charted, for &lt;apex:selectList&gt;
    public static List&lt;SelectOption&gt; getChartYearOptions() {
        List&lt;SelectOption&gt; years = new List&lt;SelectOption&gt;();
        years.add(new SelectOption('2013','2013'));
        years.add(new SelectOption('2012','2012'));
        years.add(new SelectOption('2011','2011'));
        years.add(new SelectOption('2010','2010'));
        return years;
    }

    public List&lt;PieWedgeData&gt; getPieData() {
        // Visualforce expressions can't pass parameters, so get from property
        return PieChartRemoteController.generatePieData(this.chartYear);
    }

    @RemoteAction
    public static List&lt;PieWedgeData&gt; getRemotePieData(String year) {
        // Remoting calls can send parameters with the call
        return PieChartRemoteController.generatePieData(year);
    }

    // Private data "generator"
    private static List&lt;PieWedgeData&gt; generatePieData(String year) {
        List&lt;PieWedgeData&gt; data = new List&lt;PieWedgeData&gt;();
        if(year.equals('2013')) {
            data.add(new PieWedgeData('Jan', 30));
            data.add(new PieWedgeData('Feb', 15));
            data.add(new PieWedgeData('Mar', 10));
            data.add(new PieWedgeData('Apr', 20));
            data.add(new PieWedgeData('May', 20));
            data.add(new PieWedgeData('Jun',  5));
        }
        else {
            data.add(new PieWedgeData('Jan', 20));
            data.add(new PieWedgeData('Feb', 35));
            data.add(new PieWedgeData('Mar', 30));
            data.add(new PieWedgeData('Apr', 40));
            data.add(new PieWedgeData('May',  5));
            data.add(new PieWedgeData('Jun', 10));
        }
        return data;
    }

    // Wrapper class
    public class PieWedgeData {

        public String name { get; set; }
        public Integer data { get; set; }

        public PieWedgeData(String name, Integer data) {
            this.name = name;
            this.data = data;
        }
    }
}</pre>
<p>The code is pretty ordinary, except perhaps in that it supports getting chart data via two different methods. <code>getPieData()</code> is intended to be used in a Visualforce expression as <code>{! pieData }</code>, while <code>getRemotePieData()</code> is, as you might guess by the <code>@RemoteAction</code> annotation, intended to be called directly using JavaScript Remoting.</p>
<p>Here&#8217;s the Visualforce page, with the two different charts in separate <code>&lt;apex:pageBlockSection&gt;</code>s:</p>
<pre>&lt;apex:page controller="PieChartRemoteController"&gt;
    &lt;apex:pageBlock title="Charts"&gt;

         &lt;apex:pageBlockSection title="Standard Visualforce Charting"&gt;

            &lt;apex:outputPanel id="theChart"&gt;
            &lt;apex:chart height="350" width="450" data="{!pieData}"&gt;
                &lt;apex:pieSeries dataField="data" labelField="name"/&gt;
                &lt;apex:legend position="right"/&gt;
            &lt;/apex:chart&gt;
            &lt;/apex:outputPanel&gt;

            &lt;apex:form &gt;
                &lt;apex:selectList value="{!chartYear}" size="1"&gt;
                    &lt;apex:selectOptions value="{!chartYearOptions}"/&gt;
                    &lt;apex:actionSupport event="onchange" reRender="theChart"
                        status="actionStatusDisplay"/&gt;
                &lt;/apex:selectList&gt;
                &lt;apex:actionStatus id="actionStatusDisplay"
                    startText="loading..." stopText=""/&gt;
            &lt;/apex:form&gt;

        &lt;/apex:pageBlockSection&gt;

        &lt;apex:pageBlockSection title="Visualforce Charting + JavaScript Remoting"&gt;

            &lt;apex:chart height="350" width="450" data="retrieveChartData"
                name="RemotingPieChart" hidden="true"&gt;
                &lt;apex:pieSeries dataField="data" labelField="name"/&gt;
                &lt;apex:legend position="right"/&gt;
            &lt;/apex:chart&gt;

            &lt;div&gt;
                &lt;select id="theYear" onChange="refreshRemoteChart();"&gt;
                    &lt;option value="2013"&gt;2013&lt;/option&gt;
                    &lt;option value="2012"&gt;2012&lt;/option&gt;
                    &lt;option value="2011"&gt;2011&lt;/option&gt;
                    &lt;option value="2010"&gt;2010&lt;/option&gt;
                &lt;/select&gt;
                &lt;span id="statusDisplay"&gt;&lt;/span&gt;
                &lt;span id="remoteResponseErrors"&gt;&lt;/span&gt;
            &lt;/div&gt;

        &lt;/apex:pageBlockSection&gt;

    &lt;/apex:pageBlock&gt;
&lt;/apex:page&gt;</pre>
<p>The &#8220;normal&#8221; Visualforce chart is on lines 4-23, and the Remoting-based chart (well, most of it) is on lines 25-46. You can see that they have similar forms: both <code>&lt;apex:pageBlockSection&gt;</code>s have two blocks of their own, the chart block and the year selection menu form. The two chart blocks are nearly identical, the only meaningful difference is the data attribute for the <code>&lt;apex:chart&gt;</code> tag. The Visualforce chart uses an expression to call a controller method that provides the data. The Remoting chart data attribute is&#8230;well, it looks like just a string. I&#8217;ll get right back to that. The year selection form for the Visualforce chart uses the expected Visualforce tags, including <code>&lt;apex:actionSupport&gt;</code> to provide the refreshing and <code>&lt;apex:actionStatus&gt;</code> to display a simple &#8220;loading&#8221; message during a refresh. In contrast, the Remoting version uses static HTML, more to show that you can than because it&#8217;s required, and has no apparent way to trigger a refresh.</p>
<p>In the above code sample, the two charts appear to have roughly the same number of lines of code. The thing is, I left off part of the Remoting chart&#8217;s code. The <strong>JavaScript</strong> part of JavaScript Remoting. This part goes between the opening <code>&lt;apex:page&gt;</code> and the <code>&lt;apex:pageBlock&gt;</code> tags:</p>
<pre>    &lt;script&gt;
    function retrieveChartData(callback) {
       var year = document.getElementById('theYear').value;
       Visualforce.remoting.Manager.invokeAction(
           '{!$RemoteAction.PieChartRemoteController.getRemotePieData}',
           year,
           function(result, event) {
               if(event.status &amp;&amp; result &amp;&amp; (result.constructor === Array)) {
                   callback(result);
                   RemotingPieChart.show();
               }
               else if (event.type === 'exception') {
                   document.getElementById("remoteResponseErrors").innerHTML = event.message +
                       '&lt;br/&gt;' + event.where;
               }
               else {
                   document.getElementById("remoteResponseErrors").innerHTML = event.message;
               }                   
           },
           { escape: true }
       );
    }
    function refreshRemoteChart() {
        var statusElement = document.getElementById('statusDisplay');
        statusElement.innerHTML = "loading...";
        retrieveChartData(function(statusElement){
                return function(data){
                    RemotingPieChart.reload(data);
                    statusElement.innerHTML = '';
                };
            }(statusElement)
        );
    }
    &lt;/script&gt;</pre>
<p>This is the most interesting part of the page, at least for understanding how to combine Visualforce charting and JavaScript Remoting. These two JavaScript functions are the glue between the Visualforce chart and the <code>@RemoteAction</code> controller method that provides the data. There are three links between the functions and the chart component you should notice:</p>
<ol>
<li>The chart component&#8217;s <code>data</code> attribute is the string &#8220;retrieveChartData&#8221;, which is the name of the first JavaScript function. This tells the chart component to use the JavaScript function to load its data. <code>retrieveChartData()</code> is only invoked once by the chart component directly, when the chart is first created and the data is initially loaded.</li>
<li>Reloading happens when the second JavaScript function, <code>refreshRemoteChart()</code>, is called. This is the second link, and it&#8217;s actually from the year menu item, a static HTML element, which has an <code>onChange</code> attribute of <code>refreshRemoteChart();</code>. When you make a change to the menu, <code>refreshRemoteChart()</code> is invoked, and it re-invokes the <code>retrieveChartData()</code> function to load a new set of data.</li>
<li>When <code>refreshRemoteChart()</code> invokes <code>retrieveChartData()</code> it provides an anonymous function as a callback, which handles the result of the <code>@RemoteAction</code> call when it returns. This callback is what actually updates the chart, by calling <code>RemotingPieChart.reload(data)</code>. <code>RemotingPieChart</code> is the name I gave to the chart component, on line 29 of the first sample, and <code>reload()</code> is a JavaScript function available on it that accepts new data and then redraws the chart.</li>
</ol>
<p>Here&#8217;s a more visual way to see these links between the different components of the page:</p>
<p><a class="overlay" href="http://blogs.developerforce.com/tech-pubs/files/2013/05/charting-remoting-sequence.png"><img class="alignnone size-full wp-image-5893" src="http://blogs.developerforce.com/tech-pubs/files/2013/05/charting-remoting-sequence.png" alt="Updating Visualforce Charts with JavaScript Remoting" width="470" height="338" /></a></p>
<p>The sequence for the initial loading of the chart is simple: the <code>&lt;apex:chart&gt;</code> named <code>RemotePieChart</code> calls <code>retrieveChartData()</code> to get its initial data, and <code>retrieveChartData()</code> calls <code>RemotePieChart.show()</code> when it has the data. And, the chart appears.</p>
<p>Updates are more complicated. When a new year is chosen from the <code>theYear</code> menu, the menu&#8217;s <code>onChange</code> event fires, which calls <code>refreshRemoteChart()</code>. <code>refreshRemoteChart()</code> in turn calls <code>retrieveChartData()</code>, and when that returns new data, it (via the callback it created) calls <code>RemotePieChart.reload()</code>. And, the chart updates.</p>
<p>The structure of this code sample may seem complicated at first, but it provides a great deal of flexibility in what to display or change at various points in the update cycle. Once you study it a bit, and spend some time writing JavaScript user interface code, you&#8217;ll find that it&#8217;s perfectly natural.</p>
<p>Here are a couple of other items to note.</p>
<ul>
<li>The <code>&lt;apex:chart&gt;</code> uses the <code>hidden="true"</code> attribute to prevent the chart from displaying before there&#8217;s data to display. The <code>retrieveChartData()</code> function calls <code>RemotingPieChart.show()</code> to display the chart once the chart data is loaded. This and <code>RemotingPieChart.reload()</code> provide for much smoother chart animations than what is achieved using <code>&lt;apex:actionSupport&gt;</code>. Add this code into your own org and compare the two.</li>
<li>The <code>refreshRemoteData()</code> function sets the <code>statusElement</code> HTML <code>&lt;span&gt;</code> to a &#8220;loading&#8230;&#8221; message before it attempts to update the data by calling <code>retrieveChartData()</code>, and then the anonymous callback function sets it to an empty string to hide the message once the data is returned and the chart updated. It&#8217;s a bit more work than using <code>&lt;apex:actionStatus&gt;</code> for basically the same effect. You could easily show a &#8220;busy&#8221; animation or graphic using the same technique.</li>
</ul>
<p>This article was inspired by a <a title="Loading Visualforce charts with RemoteAction" href="http://boards.developerforce.com/t5/Visualforce-Development/Loading-Visualforce-charts-with-RemoteAction/td-p/611253">recent post</a> in the <a title="The Visualforce forum on developer.force.com" href="http://boards.developerforce.com/t5/Visualforce-Development/bd-p/Visualforce">Visualforce discussion forum</a>, which asked about using JavaScript Remoting to load and update chart data, and how to get the chart to draw with that data. We answered the question in the discussion, but I wanted to also expand the existing documentation on the topic. The code sample in this article, and the explanation (in substantially different form), will appear in a future edition of the Visualforce Developer&#8217;s Guide. I hope it&#8217;s useful, and interesting, to get a preview of that documentation a little early.</p>
<img src="http://feeds.feedburner.com/~r/SforceBlog/~4/V7J5wvxCHLA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blogs.developerforce.com/tech-pubs/2013/06/updating-visualforce-chart-data.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blogs.developerforce.com/tech-pubs/2013/06/updating-visualforce-chart-data.html</feedburner:origLink></item>
	</channel>
</rss>
