Skip to main content
hi

i want to create a standard acount record page in a list of records using check box ,i have entered the checkbox and record names in a page so when i click the check box the respective record name is side to the check box like wise list of records names with check boxes are available in page when i enter submit button by clicking checkbox the respective record name page would want to display in standard.can any one explain the code

 
7 answers
  1. May 23, 2015, 3:51 AM
    Hi Srikanth,

    Below link will be help you. In below Link we are showing Contact recod with checkbox.

    https://developer.salesforce.com/page/Wrapper_Class

    Please 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.

     

    return new PageReference('/'+selectedRecordID);

    Please let us know if this will help you.

    Thanks,

    Amit Chaudhary
0/9000