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

  • In Salesforce,How to reuse the same Page Block in Visualforce Page ?

    Posted by Kirandeep on January 23, 2020 at 7:03 am

    How to reuse the same  Page Block in Visualforce Page ?

    • This discussion was modified 5 years ago by  Kirandeep.
    Anuj replied 5 years ago 2 Members · 1 Reply
  • 1 Reply
  • 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