You need to sign in to do that
Don't have an account?
Louis Summers
expected semi-colon found <EOF>
If you do not mind, can you please have a look at this issue?
My code is saving with no errors when saving so this is a runtime error, and I am executing in Anonymous Window the following:
AccountHandler.insertNewAccount(Acme Supply)
I am receiving the following error:
Line: 2, Column: 0 expecting a semi-colon, found '<EOF>'
There is not Line 2 in my code, and I do not know what to say about column 0.
Here is my code ( I am a newbie, trying to learn Apex)
public class AccountHandler {
public static List<String> insertNewAccount(string nameAccount) {
List<String> acctReturn = new List<String>();
try {
Account acct = new Account(Name=nameAccount);
insert acct;
System.debug(nameAccount);
}
catch (DMLException e)
{
System.debug('A DML exception has occurred: ' + e.getMessage());
}
return acctReturn;
}
}
My code is saving with no errors when saving so this is a runtime error, and I am executing in Anonymous Window the following:
AccountHandler.insertNewAccount(Acme Supply)
I am receiving the following error:
Line: 2, Column: 0 expecting a semi-colon, found '<EOF>'
There is not Line 2 in my code, and I do not know what to say about column 0.
Here is my code ( I am a newbie, trying to learn Apex)
public class AccountHandler {
public static List<String> insertNewAccount(string nameAccount) {
List<String> acctReturn = new List<String>();
try {
Account acct = new Account(Name=nameAccount);
insert acct;
System.debug(nameAccount);
}
catch (DMLException e)
{
System.debug('A DML exception has occurred: ' + e.getMessage());
}
return acctReturn;
}
}
You need it to be: AccountHandler.insertNewAccount('Acme Supply');