Skip to content

Instantly share code, notes, and snippets.

@townie
Last active September 12, 2016 03:03
Show Gist options
  • Save townie/6e7e433339edf115abe787eb50b501c7 to your computer and use it in GitHub Desktop.
Save townie/6e7e433339edf115abe787eb50b501c7 to your computer and use it in GitHub Desktop.
String info = 'Starting Program';
// SOQL query to load data into object(s)
// Load ALL books into the list of books
List<Book__c> books = [SELECT Price__c, Name From Book__c];
// Load only 1 book into a single book object
Book__c book = [SELECT Price__c, Name From Book__c limit 1];
// run method to update fields
MyHelloWorld.kimIsReallyTheBest(books);
// actually update records in database
update books;
// now set price on books manually
for (Book__c b :books) {
b.Price__c = 10;
}
// actually update records in database
update books;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment