Created
September 20, 2014 07:39
-
-
Save cdeckert/ac99ab8afc882ea759be to your computer and use it in GitHub Desktop.
Revisions
-
cdeckert created this gist
Sep 20, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ public void massUpdate() { // first loop (don't forget to use Lists for (List < Contact > contacts: [SELECT FirstName, LastName FROM Contact]) { for (Contact c: contacts) { // 2nd for loop if (c.FirstName == 'Barbara' && c.LastName == 'Gordon') { c.LastName = 'Wayne'; } } update contacts; // update is part of the 1st for loop } }