You need to sign in to do that
Don't have an account?
Vignesh Ramshetty
Below is the code for one record if i want to insert 5 records a time then what would be the code
Contact con = new Contact();
con.Firstname = 'Vignesh';
con.Lastname = 'Ramshetty';
con.Phone = '9666266129';
insert con;
con.Firstname = 'Vignesh';
con.Lastname = 'Ramshetty';
con.Phone = '9666266129';
insert con;
In that scenerio you can insert each contact but the best way is to add to the list and inset the list at once so only one DML wil count as below.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
The code can be as below.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
con.Firstname = 'Vignesh'
; con.Lastname = 'Ramshetty';
con.Phone = '9666266129';
con.Firstname = 'Tony'
; con.Lastname = 'mogli';
con.Phone = '9666786129';
con.Firstname = 'Tillu'
; con.Lastname = 'mogli';
con.Phone = '9665288129';
con.Firstname = 'Karthik' +i
; con.Lastname = 'sai';
con.Phone = '9665277129';
con.Firstname = 'Harry'
; con.Lastname = 'jerry';
con.Phone = '9662688129';
In that scenerio you can insert each contact but the best way is to add to the list and inset the list at once so only one DML wil count as below.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,