You need to sign in to do that
Don't have an account?
Ola Bamidele
PageReference Error - Urgent!
Hi Gurus,
I have writting an apex code that redirects users to a different language page when they click the link in the Visualforce page.
However, I am getting an errior on line 10 saying "Missing return statement required return type: System.PageReference"
Please if you know how to overcome it then let me know please!
Thanks!
I have writting an apex code that redirects users to a different language page when they click the link in the Visualforce page.
However, I am getting an errior on line 10 saying "Missing return statement required return type: System.PageReference"
public with sharing class CustomerSatTest{ public String currentRecordId {get;set;} public String VFPageName{get;set;} public CustomerSatTest (ApexPages.StandardController controller){ this.currentRecordId = ApexPages.CurrentPage().getparameters().get('id'); } public PageReference RedirectHelper (String VFPageName) { this.VFPageName = VFPageName; pageRedirect(); } public PageReference pageRedirect() { PageReference pageref = new PageReference('/apex/' + VFPageName + '?Id='+currentRecordId); pageref.setRedirect(true); return pageref; } }
Please if you know how to overcome it then let me know please!
Thanks!
Make this method return type as void instead if pagereference.
Thanks for the reply. I tried your code but it didnt work unfortunately and I recieved 6 errors XD
Thanks!
I did that previosuly here:
Howeve when I have 4 page references in the apex, only one of the links work.
DO you know how I can resolve this?
Thanks very much!