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 with sharing class AccountTriggerHandler { | |
public static void handleBeforeInsert(List<Account> newAccounts){ | |
for (Account a : newAccounts) { | |
if (a.Est_Annual_Sales__c >= 5000000) { | |
a.Priority__c = 'Highest'; | |
} else if (a.Est_Annual_Sales__c >= 3000000) { | |
a.Priority__c = 'High'; | |
} else if (a.Est_Annual_Sales__c >= 1000000) { | |
a.Priority__c = 'Standard'; |
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 with sharing class WeekFourHomework { | |
//Let's practice calling different methods by writing our very own methods. You will write and save methods in the space below | |
//that call the existing methods you see already written here. Ready? Let's Go! | |
//Sample: Here is a public method that calls the getCitiesForExpansion below and prints the results to our debug log | |
public static void printOutCitiesForExpansionDemo() { | |
//The code on the left of the equals sign instantiates a list of Strings, the code on the right side calls our method and returns a list of cities | |
//the equals sign assigns the returned value, to the list we created |
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
global class PagingSortingController { | |
@AuraEnabled global static Account[] getAccounts() { | |
return [SELECT Name, Industry, AnnualRevenue FROM Account LIMIT 1000]; | |
} | |
} |
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
/** | |
* Used to read a delimited file. | |
*/ | |
public class SSSCsvReader { | |
private String delim = ','; | |
// the input data | |
private String[] buffer; | |
public SSSCsvReader(String data){ | |
this.buffer = data.split('\n'); |