function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

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





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',;



insert l1;


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.