Code below;
public class AccountHandler {
public static void insertAccount(Integer numNewAccounts){
List<Account> addAccounts = new List<Account>();
Integer counter = 1;
while(counter <= numNewAccounts ){
Account a = new Account();
= 'Acme Inc ' + counter;
a.AccountNumber = 'A000' + counter;
addAccounts.add(a);
counter++;
}
insert addAccounts;
}
}
#Trailhead Challenges
Ruchit Patel (Cognizant) Forum Ambassador
can you share screenshot of error message you are getting? Thanks!