You need to sign in to do that
Don't have an account?
Hanusha Ganji
Method does not exist or incorrect signature: void insertNewAccount(String) from the type AccountHandler
Hi All,
Method does not exist or incorrect signature: void insertNewAccount(String) from the type AccountHandler
This is the error with which i am struck from very long time.
this is my code
public class AccountHandler {
public Static Account insertNewAccount(String an){
Account acc = new Account(name=an);
try{
insert acc;
return acc;
}
catch(DMLException e){
return null;
}
}
}
Debug :
Account acc = AccountHandler.insertNewAccount('Test Record');
Method does not exist or incorrect signature: void insertNewAccount(String) from the type AccountHandler
This is the error with which i am struck from very long time.
this is my code
public class AccountHandler {
public Static Account insertNewAccount(String an){
Account acc = new Account(name=an);
try{
insert acc;
return acc;
}
catch(DMLException e){
return null;
}
}
}
Debug :
Account acc = AccountHandler.insertNewAccount('Test Record');
It looks ok to me. Can you try compiling all classes via Setup?
Hi Hanusha,
I tried replicating this in my org and it is working fine. Could you please check it again.
Regards,
Priya Ranjan
Hi,
Your code is correct. Press ctrl+R to refresh the console.
after that you are getting the same error then create new class and new method and execute it.
Don't forget to save the console.
Please mark it as the Best Answer if it helps you.
Thank You
Thank you all for your responses!!! It's working fine now ,i am able to get the required output.