public class addAttendee {
public Account accounts;
public Contact del;
public Account acc1;
public List<Contact> addattendeeList {get;set;}
public List<Contact> delattendeeList {get;set;}
public List<Contact> attendeeList {get;set;}
public List<Contact> delAttendees {get; set;}
public Integer totalCount {get;set;}
public Integer rowIndex {get;set;}
public addAttendee(ApexPages.StandardController controller) {
acc1=[Select Name from Account where Id=:ApexPages.currentPage.getParameters().get('Id')];
attendeeList = [Select Id, firstName, LastName, Email, Phone,Account.Name from Contact where Id =:ApexPages.currentPage.getParameters().get('Id')];
System.debug(LoggingLevel.Info, 'Your info');
totalCount = attendeeList.size();
System.debug('Account Id ****'+accounts.Id);
delattendeeList = new List<Contact>();
delattendees = new List<Contact>();
}
public void addRow(){
addattendeeList = new List<Contact>();
attendeeList.add(new Contact(AccountId = ApexPages.currentPage.getParameters().get('Id')));
}
public PageReference ave(){
upsert attendeeList;
upsert acc1;
delete delattendeeList;
return (new ApexPages.StandardController(accounts)).view();
}
public PageReference cancel(){
PageReference pr = new PageReference('https://ap4.salesforce.com/001/o');
pr.setRedirect(true);
return pr;
}
public void deleteRow(){
rowIndex = Integer.valueOf(ApexPages.currentPage().getParameters().get('rowIndex'));
System.debug('rowbe deleted ' + rowIndex );
System.debug('rowm to be deleted '+attendeeList[rowIndex]);
del = attendeeList.remove(rowIndex);
delattendeeList.add(del);
}
}
I want to get the id of account on the current visualforce page so that I can add/delete multiple contacts for that particular account. But I am getting error as Method does not exist or incorrect signature: ApexPages.currentPage.getParameters() Please help me