• eggoni ashok
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
//iam executed bluk record code.i getting this dml exception.//
public class ContactUtilty {
    Public static void CreateBulconRecords()
    {
        List<Contact> lstConRecords = new List<Contact>();
        
        for(integer counter = 1; counter <= 20; counter++)
        {
            // Prepare the Record..
            Contact con = new Contact();
            
                con.LastName= 'arjunreddy - '+ counter;
                con.Fax = '0878946464';
                con.HomePhone = '9900998877';
                con.Email = 'apexhr'+counter+'@gmail.com';
            
              // Add the Record to the Collection..
              lstconRecords.Add(con);
        }
        
        if(! lstconRecords.isEmpty())
        {
            insert lstconRecords;            
        }        
    }

}