###Problem 1
pets[2];
###Problem 2
coolThings.pavan;
| public static void attemptToFindAccountIfNone(List<Case> TriggerNew){ | |
| Id recordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('BCS Case').getRecordTypeId(); | |
| List<Case> casesToUpdate = new List<Case>(); | |
| List<String> emails = new List<String>(); | |
| Map<String, Case> casesByEmails = new Map<String,Case>(); | |
| for (Case cs: TriggerNew) { | |
| //limit to BCS Cases (soon support cases), without associated Accounts, but with Web Emails | |
| if(cs.RecordTypeId == recordTypeId && cs.AccountId == null && cs.SuppliedEmail !==null){ | |
| emails.add(cs.SuppliedEmail); |
| const roomies = ["Yas", "Nate", "Owens"]; | |
| console.log("Roomies UNSORTED:", roomies); | |
| const randomRoomies = roomies.sort(function(a, b) { return 0.5 - Math.random() }); | |
| console.log("Roomies RANDOMIZED:", randomRoomies); | |
| console.log("Bottom bedroom:", Math.floor(Math.random() * randomRoomies.length)); |
| 1.The advantages of using a database include Atomocity (modifications will either all take place or the whole thing will be canceled, which helps prevent corrupted data and conflicts from half executed code), Consistancy (which helps programs and other programmers access your data), Isolation (data is queued and is modified in order, which helps Atomocity), and Durability (that data will exist until deleted). | |
| 2. | |
| 3. A database schema is something which tells the database what sort of data to expect, and what type of data it will be. | |
| 4. The browser is sending a put request, with a path of "/orders/:id". The code is taking in an id number from the path and storing an "order" object (from inputs in the browser) in an array within the data.json with an index of that id number. | |
| 5. Create, Read, Update, Destroy. Our apps will be able to modify data in all four of those ways. For example, in SQL, Create = INSERT, Read = SELECT, Update = UPDATE, and Destroy = DELETE. |
| // Using a Constructor Function, create a Cupcake Constructor. | |
| // Question 5 / 6 - Write your Cupcake Constructor Function here. | |
| var Cupcake = function (cakeFlavor, frostingFlavor){ | |
| this.cake = cakeFlavor; | |
| this.frostingFlavor = frostingFlavor; | |
| this.sprinkles = false; | |
| this.getCake = function (){ | |
| return this.cake; |
###Problem 1
pets[2];
###Problem 2
coolThings.pavan;