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
Praveen kumar TammaliPraveen kumar Tammali 

Records ?

Hi
please let me know how many recs will be inserted with below code

list<Account>acc = new list<Account>();
Account ac;
for(integer i = 0;i<10;i++){
ac = new account();
ac.Name = 'vittu'+i;
acc.add(ac);
}
insert acc;
sri sfdcsri sfdc
Hi Praveen,

10 records will insert.

To check , write a simple trigger on account object,

trigger accrecords on Account (before insert) {
 list<account> ls=trigger.new;
    for(account a :ls)
    {
        a.name='sfdc'+a.name;
        
    }
}

   

 after saving this code. 

1  Go to Debug menu and type your above code in Open Excute Anonymous Window
2  Excute 
3 Go to Account Object there you can see newly inserted 10 records 

Cheers,
Sri