• Rani S 1
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
public class AddmultipleContactsController {

Contact con = new Contact();
public list<contact> listContacts{ get; set; }

public AddmultipleContactsController()
{
listContacts=new list<Contact>();
listContacts.add(con);
}

Public void addContacts()
{
Contact cc = new Contact();
listContacts.add(cc);
}
public PageReference saveContacts() {
for(Integer i=1; i<listContacts.size(); i++)
{
insert listContacts;
}
return Page.AllContactssaved;
}
}
public class AddmultipleContactsController {

Contact con = new Contact();
public list<contact> listContacts{ get; set; }

public AddmultipleContactsController()
{
listContacts=new list<Contact>();
listContacts.add(con);
}

Public void addContacts()
{
Contact cc = new Contact();
listContacts.add(cc);
}
public PageReference saveContacts() {
for(Integer i=1; i<listContacts.size(); i++)
{
insert listContacts;
}
return Page.AllContactssaved;
}
}