You need to sign in to do that
Don't have an account?
SuAk
How to execute insert in Anonymous window in Apex
Hi - I am trying to execute the following code
public class AccountHandler {
public static Account insertNewAccount(String name) {
Account a = new Account();
a.Name = name;
try
{
insert a;
} catch (Exception e) {
return null;
}
return a;
}
}
i tried executing it in anonymous window as below :
AccountHandler.Account insertNewAccount(String name);
I would need some help on this . Please let me know if the way i execute in anonymous window is correct .
Thanks!!
public class AccountHandler {
public static Account insertNewAccount(String name) {
Account a = new Account();
a.Name = name;
try
{
insert a;
} catch (Exception e) {
return null;
}
return a;
}
}
i tried executing it in anonymous window as below :
AccountHandler.Account insertNewAccount(String name);
I would need some help on this . Please let me know if the way i execute in anonymous window is correct .
Thanks!!
All Answers
AccountHandler.insertNewAccount("your string here");
AccountHandler.insertNewAccount('your string here');