public class ContactProcessor { public static void insertContact(){ List<Contact> conList = new List<Contact>(); Contact con; for(Integer i = 0; i < 500; i++){ con = new Contact(); con.LastName = 'Test ' +i; conList.add(con); } if(conList.size()>0) insert conList; } }
// Run this class in execute anonymous window (Ctrl+E). ContactProcessor.insertContact();
As mentioned by Shubham, if we are inserting 500 contacts for an Account then there is 1:N relationship.
This post of insert 500 Contact records for an Account record and 1 to 1 mapping should be there between them, is so helpful as well for the new ones but there are also very intellectual and desiring in giving best dissertation writing help (https://londondissertations.co.uk/) from them in all the way to London city reflectively.
If we are inserting 500 contacts for an Account then there is 1 to many relationship.
Can you please explain it more?
Thanks
Shubham Jain
Code to insert 500 contact records =>
public class ContactProcessor {
public static void insertContact(){
List<Contact> conList = new List<Contact>();
Contact con;
for(Integer i = 0; i < 500; i++){
con = new Contact();
con.LastName = 'Test ' +i;
conList.add(con);
}
if(conList.size()>0) insert conList;
}
}
// Run this class in execute anonymous window (Ctrl+E).
ContactProcessor.insertContact();
As mentioned by Shubham, if we are inserting 500 contacts for an Account then there is 1:N relationship.
Thanks
Harshit Kumar