I want to add multiple accounts to the salesforce object from the anonymous window. I know how to do that using the below code
Account acc = new Account(Name='account1');
List<Account> accToAdd = new List<Account>();
accToAdd.add(acc);
insert accToAdd;
but when I am trying to insert multiple accounts(see code below), it is giving me error as "Line: 1, Column: 5 Unexpected token '<'."
List<Account> accToAdd = new List<Account>(
{ new Account(Name='triggertest4'),
new Account(Name='triggertest5'),
new Account(Name='triggertest3')
});
insert accToAdd;
can anyone help???