Activity Forums Salesforce® Discussions In Salesforce,How to reuse the same Page Block in Visualforce Page ?

  • Anuj

    Member
    January 23, 2020 at 11:15 am

    Hi Kirandeep Kaur,

    Make a list of that particular object in Controller class  and initialize the object in any method and bind that method in Button in Visualforce page , Also take Boolean Variable and set 'True' the variable in method

    For Example see the below code.

      public list<contact> listOfContact{get;set;}
        contact ContactObject= new Contact();
    
      public void AddMoreContact()
        {
           accountBoolvalue = false;
           contactBoolValue = true; 
            contact ContactObject= new Contact();
            ContactObject.accountId= account.Id;
            listOfContact.add(ContactObject);
            InsertSuccess= false;
        }
    

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos