Another Salesforce blog!!!

Salesforce, Apex

Redirecting BACK to the original page


VFP:

<apex:commandButton action="{!backReturn}" value="Back"/>

Controller:

public with sharing class SaveAndReturnController
{
    private ApexPages.StandardController controller;

    public SaveAndReturnController(ApexPages.StandardController controller)
    {
        this.controller = controller;
    }

    public PageReference backReturn()
    {
        PageReference cancel = controller.cancel();
        //controller.save();
        return cancel;
    }
}

Leave a Reply

Your email address will not be published.

*