Created
February 24, 2017 15:01
-
-
Save JimBTek/edb0c35a5d2719b36c5c37703dbcffa9 to your computer and use it in GitHub Desktop.
Trailhead Apex method
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 class AccountHandler { | |
public static String insertNewAccount(String acctName) { | |
Account acct = new Account (Name = acctName); | |
try{ | |
insert acct; | |
Account returnAcct = [select id, Name from Account where Name = 'acctName' limit 1]; | |
} | |
catch (DmlException e) { | |
System.debug('A DML exception has occurred: ' + e.getMessage()); | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment