FavoriteDavid Roberts (Logicom Computer Services (UK) Ltd) asked in #VisualforceOct 26, 2022, 10:26 AMWhen calling an apex method from a visualforce page, when should the method be of type PageReference and when should we use Void?When calling an apex method from any of the followingapex;commandbuttonapex:actionSupportapex:actionFunctionetcShould it always be a PageReference type rather than a void?1 answerSortSort by Most HelpfulSort by Most HelpfulSort by DateMagulan Duraipandian (Salesforce)Jan 4, 11:37 PMVoid - method will fire and page will be re-rendered.PageReference - method will fire and navigate to a different page.https://www.infallibletechie.com/2012/02/to-open-new-page-from-current-page.htmlWrite an answer...BoldItalicUnderlineStrikethroughBulleted ListNumbered ListAdd linkCode blockInsert imageAttach filesLink URLCancelSave0/9000Reply
Magulan Duraipandian (Salesforce)Jan 4, 11:37 PMVoid - method will fire and page will be re-rendered.PageReference - method will fire and navigate to a different page.https://www.infallibletechie.com/2012/02/to-open-new-page-from-current-page.html