You need to sign in to do that
Don't have an account?
Sonam Patil
Trailhead Challenge Problem
Hi,
Can anyone help me.
Below is my code, this is a trailhead challenge.
I am getting this error:Executing the insertNewMethod failed. Either the method does not exist, or not static or doesn't insert a proper method.
public class AccountHandler {
public static Account insertNewAccount(String abc){
Account a = new Account();
if(abc==''){
try{
a.Name='abc';
insert a;
}
catch(Exception e){
// a.Name='abc';
return null;
}
}
else{
a.Name='abc';
insert a;
}
return a;
}
}
Below is my code, this is a trailhead challenge.
I am getting this error:Executing the insertNewMethod failed. Either the method does not exist, or not static or doesn't insert a proper method.
public class AccountHandler {
public static Account insertNewAccount(String abc){
Account a = new Account();
if(abc==''){
try{
a.Name='abc';
insert a;
}
catch(Exception e){
// a.Name='abc';
return null;
}
}
else{
a.Name='abc';
insert a;
}
return a;
}
}
Let us know if this will help you
Thanks
Amit chaudhary