4 Antworten
Please updatr your code like below
I found below issue in your code1) a.Name = 'name';it should be like belowa.Name = name;Let us know if this will help youpublic class AccountHandler{
public static Account insertNewAccount(String AccName){
try{
Account acc = new Account(Name=AccName);
insert acc;
return acc;
} catch(Exception e) {
System.debug('Exception is:'+ e.getMessage());
return null;
}
}
}