Hi Srikanth,Below link will be help you. In below Link we are showing Contact recod with checkbox.https://developer.salesforce.com/page/Wrapper_ClassPlease replace "processSelected " function with below function.
public PageReference processSelected()
{
List<Contact> selectedContacts = new List<Contact>();
for(cContact cCon: getContacts())
{
if(cCon.selected == true)
{
selectedContacts.add(cCon.con);
}
}
String selectedRecordID = '' ;
for(Contact con : selectedContacts)
{
system.debug(con);
selectedRecordID = con.id;
}
contactList=null; // we need this line if we performed a write operation because getContacts gets a fresh list now
return new PageReference('/'+selectedRecordID);
//return null;
}
Only on concurn i have with your design in list view you are showing checkbox. With Checkbox your can select multiple record at a time but above code will open only one record.
Please let us know if this will help you.Thanks,Amit Chaudharyreturn new PageReference('/'+selectedRecordID);
7 answers