Activity › Forums › Salesforce® Discussions › In What Order Do Methods Fire Within A Salesforce Controller?
Tagged: Action Methods, Methods in Salesforce, Order of Execution, Salesforce Controller, Variables and Methods
-
In What Order Do Methods Fire Within A Salesforce Controller?
Posted by chanchal kumar on July 27, 2018 at 12:52 PMIn What Order Do Methods Fire Within A Salesforce Controller?
Parul replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hello Chanchal,
If you are asking the order of execution of setter and getter values then Setter is fired first, a then getter fires.
A setter is called before the action methods, the action method executes will be accessing the variable that was set.
Thanks.
- [adinserter block='9']
-
Hi,
The constructor is called when a page using the controller is first viewed (unless you’ve just come from another page that uses the same controller).
Getters are called as the page is rendered to fill in information, then actions are typically fired after in response to a button press or similar. <apex:actionPoller> renderes every n seconds where you define the time, and if it re-renders part of the page (or the whole page) the getters would be called after the action is performed.
Thanks.
-
The constructor is fired after that the order is in the order that the methods are called by the page. Setters methods are called before action methods, but there is no guarantee of the precise order.
Thanks
Log In to reply.