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 characters
| AccountTriggerHandler.handleAfterInsert | |
| public static void handleAfterInsert(List<Account> newAccounts){ | |
| Id runningUserId = UserInfo.getUserId(); | |
| //JW: Only need to do this query once outside of the loop. | |
| User u = [SELECT Id, Email FROM User WHERE Id = :runningUserId]; | |
| //JW:Create an empty case list to store the case information | |
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 characters
| public with sharing class WeekSevenHomework { | |
| //Assignment: The following method is supposed to create the number of accounts specified in the argument that it takes. | |
| //Each Account should be named 'Sample Account #sampleNumber' where sample number is the count. So if you created 2 Accounts | |
| //one would be called 'Sample Account 1' and the other 'Sample Account 2' | |
| //Also, when we're done inserting them, we will create a case for each one with a Status of 'New', Origin of 'New Account' and the | |
| //desription and subject of your choice. | |
| //This isn't working quite right. Can you use your debugging skills to fix it? I had to comment it out since it won't compile |
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 characters
| public with sharing class WeekSixHomework { | |
| // Remember Sets & Maps?? We did a little practice with Lists in week 2, but we need to make sure we know how to use Sets & Maps as well!! | |
| public static void setsReview(){ | |
| //Your assignment: Play with Sets! | |
| // 1. Create a set of Strings and add at least 5 entries | |
| //JW - Creating my shopping list | |
| Set<String> shoppingList = new Set<String>(); |
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 characters
| //1. Write a public method that calls the getCitiesForExpansion method to get a list of cities, then add | |
| //another city to the list before printing it to the debug log. | |
| //(see the sample above for an example of calling that method-You can even start by copying and pasting that method here, renaming and modifying it) | |
| //JW: Adding additional city and printing to the debug list | |
| public static void printOutCitiesForExpansionWithExtraCity() { | |
| List<String> cities = getCitiesForExpansion(); | |
| cities.add('Gold Coast'); // add another city | |
| System.debug('Here are the printed cities: ' + cities); | |
| } |
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 characters
| public with sharing class WeekFourHomework { | |
| public static void soqlPractice() { | |
| //1. Below is a SOQL query that should be returning the top 5 Accounts in our org based on Annual Revenue. | |
| //Something's not quite right, can you fix the query? | |
| //JW: No need for the ID as this is our freebee not limited and not sorted by top 5. | |
| List<Account> topFiveAccounts = [SELECT Name, AnnualRevenue FROM Account WHERE AnnualRevenue != 0 ORDER BY AnnualRevenue DESC Limit 5]; { | |
| System.debug('This should be 5: ' + topFiveAccounts.size()); |
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 characters
| public with sharing class WeekThreeHomework { | |
| public static void homeworkAssignmentMethod() { | |
| //Read through the setup below and then complete the code following the prompts. When you're done, make sure to compile (save) your work | |
| //Open Execute Anonymous in the Developer Console and execute your code by typing in: WeekThreeHomework.homeworkAssignmentMethod(); | |
| //Read through the debug statements to make sure you're done your work correctly. | |
| //************************************************************************************************************ |
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 characters
| CommentingOnCodeExercise { | |
| public static void cartValues() { | |
| //Declaring and Initialising a variable. Datatype = Integer. Variable name = CartValue and assigning the minimum number value of 50. | |
| Integer minimumCartValue = 50; | |
| // Declaring and Initialising the variables. | |
| Integer itemA = 10; | |
| Integer itemB = 20; |
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 characters
| //I am going to use the example of taking out the trash as apart of the week 1 Psuedocode activity | |
| //Step 1 is to remove the existing trash from the trash bag | |
| /*Lift the lid from the bin you would like to remove the trash from. Remove lid completely and place it besides the bin | |
| if the lid is able to be completely removed*/ | |
| //Step 2 is to seal the internal garbage bag liner and remove from the external garbage bag | |
| /*Gather the top handles of the internal garbage bag line and tie this into a knot and completely seal the garbage within |
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 characters
| Welcome.apxc | |
| //Ok, let's get started! | |
| public static void youDoThisPart() { | |
| /*Your assignment is to write two comments below this one. They should describe the few lines of code you see below. | |
| Simply describe what the code is doing based on what you learned from readings and in class. | |
| Make one as a single line comment using the // notation. Make the other one a multi line comment using the /* notation. | |
| When you're done, save this file so that it is compiled and stored in Salesforce. */ |