본문 바로가기

분류 전체보기28

[Developer Beginner] Apex Triggers | Get Started with Apex Triggers 오 통과ㅋ trigger AccountAddressTrigger on Account (before insert, before update) { //BillingPostalCode //ShippingPostalCode //Match_Billing_Address__c is true, // 위는 정확한 API명 //billing postal code true && match_billing accress__c true일 때 //shipping postal code를 세팅할 것 for(Account a : Trigger.New) { if(a.Match_Billing_Address__c == true && a.BillingPostalCode != '') { a.ShippingPostalCode = a.Billing.. 2021. 3. 22.
[Developer Beginner] Apex Basics & Database | Write SOQL Queries 처음엔 mailingPostalCode에서 에러 나더니 또 되네; 왜 그런담 public class ContactSearch { public static List searchForContacts(String lastName, String mailingPostalCode) { List answer = new List(); Contact[] conList = [SELECT ID, Name FROM Contact WHERE LastName=:lastName AND MailingPostalCode=:mailingPostalCode]; //lastname = a && mailingPostalCode = b //cf. MailingPostalCode //return Contact records[] list, inc.. 2021. 3. 19.
Developer Beginner | Apex Basics & Database | Manipulate Records with DML public class AccountHandler { public static Account insertNewAccount(String name) { Account answer = null; try { Account acct = new Account(Name = name); insert acct; ID acctId = acct.Id; answer = [SELECT Name from Account WHERE Id=:acctId]; } catch (DmlException e) { System.debug(e.getMessage()); } return answer; } } Challenge Code 통과 빈 문자열 넣으면 아래와 같이 log 찍힘 2021. 3. 19.
처음 작성한 Apex code ㅋㅋㅋ 그냥 기념하려고 써본다... declarative dev만 하다가 ㅠㅠㅠ 뭘 써봐서 ㅠㅠㅠ 감동함 ㅠㅠㅠ 그리구 한방에 통과 ㅠㅠㅠ 2021. 3. 18.