[SalesForce] Does saveURL and or cancelURL work on a visualforce page with a standardController

I am attempting to use a custom VF page that has some limited form data.

It uses a standard controller, and the command button I use for the {!save} action is pointing directly at the standard controller function.

However, when I pass a "saveURL" and or a "cancelURL" – neither of them are respected.

Do these options only work on standard page layouts?

I shouldn't have to write apex for a simple window redirect 🙁

EDIT:
Here is what the page looks like:
The user is navigated here by a window.location update on a previous page that that looks like the following:

...location = "/apex/shipment_quickNew?saveURL=" + mySaveURL + "&cancelURL=" + myCancelURL;

< apex:page standardController="Shipment__c" extensions="shipment_int">


<script>
function setWarehouseSelection(){
$('.Shipment__c_Warehouse__c').eq(1).val(
    $('.Shipment__c_Warehouse__c').eq(0).val()
);
}
 </script>

<div id="shipment_pageBlock">
    <apex:pageBlock title="Quick Info" id="shipment_pageBlock">      
        <apex:pageMessages ></apex:pageMessages>
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection collapsible="false" columns="2">

            <apex:pageBlockSectionItem >
                <apex:outputLabel value="{!$ObjectType.Shipment__c.Fields.Warehouse__c.Label}"></apex:outputLabel>
                <apex:outputPanel >
                    <span class="scm_requiredMark">*</span>
                    <apex:selectList value="{!Shipment__c.Warehouse__c}" multiselect="false" size="1">
                        <apex:selectOptions value="{!warehouseOptions}"></apex:selectOptions>
                    </apex:selectList>
                </apex:outputPanel>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
</div>

Best Answer

I've never tried but you might override the retURL by your mySaveURL/myCancelURL in javascript on 'onclick'.

<apex:commandButton action="{!save}" onclick="javascript: window.location.assign(window.location.href+='&retURL='+mySaveURL);" />

Try to play with that.

Related Topic