You need to sign in to do that
Don't have an account?
surya yeturu
Inserting records using List a simple programm. But i am getting errors ,can anyone help please.
public class Test
{
List<Contact> acctList = new List<Contact>();
Contact a1 = new Contact(FirstName='Account1'LastName='sri');
Contact a2 = new Contact(FirstName='Account2' LastName='sri');
acctList.add(a1);
acctList.add(a2);
insert acctList;
}
{
List<Contact> acctList = new List<Contact>();
Contact a1 = new Contact(FirstName='Account1'LastName='sri');
Contact a2 = new Contact(FirstName='Account2' LastName='sri');
acctList.add(a1);
acctList.add(a2);
insert acctList;
}
Can you try checking the below code once:
Execute Test.method1(); from the anonymous window.
I hope this helps and in case if this comes handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej
2.Comma between FirstName and LastName