25 个回答
Following the Bob's advices...<code>public class AccountHandler { public static Account insertNewAccount (String accName){ if(accName!=''){ try{ Account a = new Account(Name=accName); insert a; System.debug('Bravo Andrè! Account created'); return a; } catch(Exception e){ System.Debug('Account not created'); return null; } } else { return null; } } }</code>