I have an Apex command button in my Visual Force page. Using that button I want to call another visual force page, which in turn should call action function written in the controller.
Please advise.
I have an Apex command button in my Visual Force page. Using that button I want to call another visual force page, which in turn should call action function written in the controller.
Please advise.
Best Answer
Put the below code in the controller action method that is being called on click of command button
Edit:
In the constructor of the 'yourVFPageName' page controller you can call any method.As @Vigneshwaran G has mentioned:
use action attribute in page to call that method. Otherwise if the method being called from constructor contains any DML statements it will throw error.