Activity Forums Salesforce® Discussions Use same Apex Class for Visualforce Page and Lightning Component in Salesforce

  • Use same Apex Class for Visualforce Page and Lightning Component in Salesforce

    Posted by krati on April 9, 2020 at 5:00 pm

    Can we use same Apex Class for Visualforce Page and Lightning Component in Salesforce?

    Deepak replied 4 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Deepak

    Member
    April 9, 2020 at 5:18 pm

    You can use the same controller class but cannot share data via the controller fields. Lightning Components do not support the view state mechanism that is used in Visualforce (as that design approach tends to lead to unnecessary data being moved to and from the client). Yes, you could use the same controller.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos