Skip to main content

I'm trying to execute this piece of code and getting the error. Can someone explain where I'm going wrong?

public class AccountHandler {

    public static void insertAccount(Integer value){

        Integer N =1;

        List <Account> addAccounts = new List <Account>();

        while (N<=value){

            Account stores = new Account();

            stores.Name ='Acme Inc'+N;

            stores.AccountNumber='A000'+N;

            addaccounts.add(stores);

            N=N+1;

        }

        insert addAccounts;

    }

    

}

2 risposte
  1. 17 ott 2024, 05:38

    The class was not saved. Upon saving, I was able to execute the code. Thanks!

0/9000