function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lee SinLee Sin 

Visualforce write logic in action or in constructor?

If I have an operation that runs on page refresh or load, where should I put that logic?

Should I put it in the controller's constructor or a method and add an 'action' property in the <apex:page action={!***}></apex:page>

Is there any difference?
mjohnson-TICmjohnson-TIC
The action method is invoked before the page is rendered, so it really depends on what you want to accomplish.