Activity Forums Salesforce® Discussions What is the use setRedirect in a Salesforce Visualforce?

  • Radhakrishna

    Member
    April 13, 2017 at 5:18 am

    Hello Suraj,

    I have a page reference that returns me to the object the user started on. It works great, except the URL is still the Visualforce page. It was my understanding that setRedirect(true) accomplished this. I know it used to work like this, but at some point this functionliaty changed and it no longer updates the url.

    Anyone know how I can accomplish the URL to be updated with my page reference? It's causing some minor confusion when people "refresh" and end up going to the VF page they just left.
    public PageReference SaveProducts() { PageReference ReturnPage = new PageReference('/' + Master.id); ReturnPage.setRedirect(true); return ReturnPage; }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos