You need to sign in to do that
Don't have an account?

can create 10contacts while create one new account?
can create 10contacts while create one new account?i mean to say when we created a new account at that time i wish to create 10 contacts at atime .how to do this .pls clarify.
thanks in advacne
Hi,
Try the below code snippet as reference:
account a=new account(name ='aa');
insert a;
list<contact> l1=new list<contact>();
for(integer i=0;i<10;i++)
{
contact cc=new contact(lastname='cc',accountid=a.id);
l1.add(cc);
}
insert l1;
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
I've written a couple of blog posts on this topic:
http://bobbuzzard.blogspot.co.uk/2011/03/edit-parent-and-child-records-with.html
http://bobbuzzard.blogspot.co.uk/2011/04/edit-parent-and-child-records-with.html