Created
September 20, 2014 07:39
-
-
Save cdeckert/ac99ab8afc882ea759be to your computer and use it in GitHub Desktop.
This file contains 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 characters
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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment