<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-6747272934569803137.post1041348735901733443..comments</id><updated>2009-02-16T10:19:03.043-08:00</updated><category term='Python'/><category term='Talend'/><category term='Google Maps'/><category term='Appirio'/><category term='DanGuggenheim'/><category term='GoogleGO'/><category term='Contest'/><category term='OAuth'/><category term='Force.com'/><category term='KyleRoche'/><category term='Cache'/><category term='Twilio'/><category term='CNAME'/><category term='Google Docs'/><category term='gwt'/><category term='competition'/><category term='Auto Number'/><category term='Google COE'/><category term='TimParker'/><category term='Azure'/><category term='CustomerPortal'/><category term='LindaEvans'/><category term='ChrisBruzzi'/><category term='Salesforce.com'/><category term='FrankHansen'/><category term='DanArrigan'/><category term='Flex'/><category term='Single Sign-On'/><category term='Tech Blog'/><category term='Chatter'/><category term='Android'/><category term='Google I/O'/><category term='Facebook'/><category term='Jason Ouellette'/><category term='Cloud'/><category term='Heroku'/><category term='Content'/><category term='Girafa'/><category term='Sites'/><category term='VMforce'/><category term='CSS'/><category term='Google Wave'/><category term='REST'/><category term='GlennWeinstein'/><category term='vmware'/><category term='Visualforce'/><category term='Developer Community'/><category term='Workflow'/><category term='MichaelMcLaughlin'/><category term='WardLoving'/><category term='Visual Force'/><category term='OpenID'/><category term='Blog Update'/><category term='Dynamic APEX'/><category term='Google Chrome'/><category term='Winter 11'/><category term='Apex'/><category term='JeffDouglas'/><category term='Ruby'/><category term='Django'/><category term='Java App Engine'/><category term='WillSupinski'/><category term='MattPruden'/><category term='Google Sidebar Gadgets'/><category term='AndreaGiometti'/><category term='TimGarthwaite'/><category term='Summer 11'/><category term='KyleFreeman'/><category term='Appengine'/><category term='Google Apps'/><title type='text'>Comments on Appirio Tech Blog: Using Client-Side Looping to Work within Salesforc...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techblog.appirio.com/feeds/1041348735901733443/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6747272934569803137/1041348735901733443/comments/default'/><link rel='alternate' type='text/html' href='http://techblog.appirio.com/2008/10/using-client-side-looping-to-work.html'/><author><name>Appirio</name><uri>http://www.blogger.com/profile/15774523927536637030</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6747272934569803137.post-2773436793008495864</id><published>2009-02-16T09:51:00.000-08:00</published><updated>2009-02-16T09:51:00.000-08:00</updated><title type='text'>Hi Chris,&lt;br&gt;&lt;br&gt;thanks for this fantastic blog! I...</title><content type='html'>Hi Chris,&lt;BR/&gt;&lt;BR/&gt;thanks for this fantastic blog! I tried this in my developeraccount, but without access. Here is my class:&lt;BR/&gt;&lt;BR/&gt;&lt;I&gt;&lt;BR/&gt;global class BatchProcessDemo {&lt;BR/&gt;webservice static void processItems() {&lt;BR/&gt;Integer queryLimit = (Limits.getLimitQueryRows() - Limits.getQueryRows()) / 2;&lt;BR/&gt;for (List&amp;lt;Account&amp;gt; sourceItemList :[select Id, Name&lt;BR/&gt;from Account&lt;BR/&gt;where Processed__c = false&lt;BR/&gt;limit :queryLimit ]) {&lt;BR/&gt;List&amp;lt;MyAccount__c&amp;gt; itemsToInsert = new List&amp;lt;MyAccount__c&amp;gt;();&lt;BR/&gt;for (Account sourceItem : sourceItemList) {&lt;BR/&gt;sourceItem.Processed__c = true;&lt;BR/&gt;MyAccount__c targetItem = new MyAccount__c();&lt;BR/&gt;targetItem.Account__c = sourceItem.Id;&lt;BR/&gt;if (Limits.getDMLRows() + itemsToInsert.size() + 1 &amp;gt;= Limits.getLimitDMLRows()) {&lt;BR/&gt;insert itemsToInsert;&lt;BR/&gt;}&lt;BR/&gt;itemsToInsert.add(targetItem);&lt;BR/&gt;}&lt;BR/&gt;update sourceItemList;&lt;BR/&gt;insert itemsToInsert;&lt;BR/&gt;}&lt;BR/&gt;}&lt;BR/&gt;}&lt;BR/&gt;&lt;/I&gt;&lt;BR/&gt;&lt;BR/&gt;and my Visualforcepage:&lt;BR/&gt;&lt;BR/&gt;&lt;I&gt;&lt;BR/&gt;&amp;lt;apex:page &amp;gt;&lt;BR/&gt;&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt;&lt;BR/&gt;function batchProcess(){&lt;BR/&gt;var iterations = document.getElementById(&amp;quot;iterations&amp;quot;).value;&lt;BR/&gt;var progress = document.getElementById(&amp;quot;progress&amp;quot;);&lt;BR/&gt;progress.innerHTML = &amp;quot;Processing iteration 1 of &amp;quot; + iterations + &amp;quot; iterations.&amp;quot;;&lt;BR/&gt;sforce.connection.sessionId = &amp;quot;{!$Api.Session_ID}&amp;quot;; //to avoid session timeout&lt;BR/&gt;for (i=1; i &amp;lt;= iterations; i++) {&lt;BR/&gt;progress.innerHTML = &amp;quot;Processing new iteration &amp;quot; + i + &amp;quot; of &amp;quot; + iterations + &amp;quot; iterations.&amp;quot;;&lt;BR/&gt;sforce.apex.execute(&amp;quot;BatchProcessDemo&amp;quot;,&amp;quot;processItems &amp;quot;,{});&lt;BR/&gt;}&lt;BR/&gt;progress.innerHTML = &amp;quot;Completed processing &amp;quot; + iterations + &amp;quot; iterations!&amp;quot;;&lt;BR/&gt;}&lt;BR/&gt;&amp;lt;/script&amp;gt;&lt;BR/&gt; &lt;BR/&gt;&amp;lt;apex:sectionHeader title=&amp;quot;Demo&amp;quot;/&amp;gt;&lt;BR/&gt;&amp;lt;apex:form &amp;gt;&lt;BR/&gt;&amp;lt;apex:pageBlock title=&amp;quot;Perform Batch Process&amp;quot;&amp;gt;&lt;BR/&gt;&amp;lt;apex:panelGrid columns=&amp;quot;2&amp;quot; id=&amp;quot;theGrid&amp;quot;&amp;gt;&lt;BR/&gt;&amp;lt;apex:outputLabel value=&amp;quot;Max. # of Iterations&amp;quot;/&amp;gt;&lt;BR/&gt;&amp;lt;input type=&amp;quot;text&amp;quot; value=&amp;quot;1&amp;quot; name=&amp;quot;iterations&amp;quot; id=&amp;quot;iterations&amp;quot;/&amp;gt;&lt;BR/&gt;&amp;lt;/apex:panelGrid&amp;gt;&lt;BR/&gt;&amp;lt;div id=&amp;quot;progress&amp;quot; style=&amp;quot;color: red&amp;quot;/&amp;gt;&lt;BR/&gt;&amp;lt;apex:pageBlockButtons &amp;gt;&lt;BR/&gt;&amp;lt;input type=&amp;quot;button&amp;quot; onclick=&amp;quot;batchProcess()&amp;quot; value=&amp;quot;Start&amp;quot; class=&amp;quot;btn&amp;quot;/&amp;gt;&lt;BR/&gt;&amp;lt;/apex:pageBlockButtons&amp;gt;&lt;BR/&gt;&amp;lt;/apex:pageBlock&amp;gt;&lt;BR/&gt;&amp;lt;/apex:form&amp;gt;&lt;BR/&gt;&amp;lt;/apex:page&amp;gt;&lt;BR/&gt;&lt;/I&gt;&lt;BR/&gt;&lt;BR/&gt;So I put in a value (like 5), push the start button. I can see the first processvalue:&lt;BR/&gt;Processing iteration 1 of 5 iterations.&lt;BR/&gt;&lt;BR/&gt;But nothing happens anymore. Do you have an Idea why it isn't working?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6747272934569803137/1041348735901733443/comments/default/2773436793008495864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6747272934569803137/1041348735901733443/comments/default/2773436793008495864'/><link rel='alternate' type='text/html' href='http://techblog.appirio.com/2008/10/using-client-side-looping-to-work.html?showComment=1234806660000#c2773436793008495864' title=''/><author><name>Anaroma303</name><uri>http://www.blogger.com/profile/18109108934128765327</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://techblog.appirio.com/2008/10/using-client-side-looping-to-work.html' ref='tag:blogger.com,1999:blog-6747272934569803137.post-1041348735901733443' source='http://www.blogger.com/feeds/6747272934569803137/posts/default/1041348735901733443' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1296191094'/></entry></feed>
