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 찍힘
'Salesforce > Trailhead' 카테고리의 다른 글
[Developer Beginner] Apex Testing | Test Apex Triggers (0) | 2021.03.22 |
---|---|
[Developer Beginner] Apex Testing | Get Started with Apex Unit Tests (0) | 2021.03.22 |
[Developer Beginner] Apex Triggers | Bulk Apex Triggers (0) | 2021.03.22 |
[Developer Beginner] Apex Triggers | Get Started with Apex Triggers (0) | 2021.03.22 |
[Developer Beginner] Apex Basics & Database | Write SOQL Queries (0) | 2021.03.19 |
댓글