• #20495
    Salesforce | Vishant Vishant #36

    How can i  display records of account, contacts, opty on the same Salesforce Visualforce page and then process the selected records using wrapper class?

    How can i  display records of account, contacts, opty on the same VF page and then process the selected records using wrapper class??

    please explain it in detail (the exact working of wrapper class)

    Tagged: , , , ,

    Salesforce | Shaharyar Shaharyar #8


    <apex:page controller=”MultipleContact” sidebar=”false”>
    <apex:form >
    <apex:pageBlock >
    <apex:pageBlockTable value=”{!listContact}” var=”cnct” id=”ref”>
    <apex:column headervalue=”Last Name”>
    <apex:inputfield value=”{!cnct.con.LastName}”/>
    <apex:column headervalue=”First Number”>
    <apex:inputfield value=”{!cnct.con.FirstName}”/>
    <apex:column headervalue=”Email”>
    <apex:inputfield value=”{!cnct.con.Email}”/>
    <apex:column headervalue=”Title”>
    <apex:inputfield value=”{!cnct.con.title}”/>
    <apex:column headervalue=”RemoveContact”>
    <apex:inputCheckbox value=”{!cnct.isSelected}”/>
    <apex:pageblockbuttons >
    <apex:commandButton value=”Add More Contact” action=”{!addContact}” reRender=”ref” />
    <apex:commandButton value=”Save Contact” action=”{!SaveContact}”/>
    <apex:commandButton value=”Remove Contact” action=”{!RemoveContact}”/>
    public class MultipleContact{

    public list<cContact> listContact{get;set;}
    public MultipleContact(){ //constructor
    listContact=new list<cContact>();
    listContact.add(new cContact(new contact()));
    public void addContact() {
    Contact cnct = new Contact();
    MultipleContact.cContact cn = new MultipleContact.cContact(cnct);
    public pagereference saveContact(){
    List<Contact> myList = new List<Contact>();
    for(cContact c : listContact){
    pagereference pg=new pagereference(‘/003/o’);
    insert myList;
    return pg;
    public pageReference RemoveContact() {
    List<cContact> li = listContact;
    for(Integer i=0 ; i<li.size(); i++){
    if(li[i].isSelected == true){
    pageReference pg1=new pageReference(‘/’);
    //delete listContact;
    return null;
    //Inner class of contact
    public class cContact{
    public Contact con{get;set;}
    public boolean isSelected{get;set;}
    public cContact(Contact con){
    this.con = con;
    isSelected = false;


    Salesforce | Vishant Vishant #36

    Actually i have to deal with all three of them(Account,contact,opportunity) on the same VF page and after selection particular records i want them to get displayed on a new page block

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.


We're not around right now. But you can send us an email and we'll get back to you, asap.


About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Property of Forcetalks.com
Copyright 2017 Forcetalks. All Right Reserved.

Log in with your credentials


Forgot your details?