You need to sign in to do that
Don't have an account?
custom controller: validation errors on cancel
Hi there.
I can't figure out how to circumvent validation when clicking a cancel button on a Visualforce page that uses a custom controller.
The page has this button:
<apex:commandButton action="{!cancel}" value="Cancel"/>
And the cancel method in the controller does this:
public PageReference cancel() { System.debug('cancel()'); String accountId = ApexPages.currentPage().getParameters().get('AccountId'); return new PageReference(accountId); }
but I never see my debug. Instead I see all the required fields on the page with red boxes ("Error: You must enter a value"). Any help would be appreciated.
Thanks.
on the commandbutton add the immediate=true parameter.
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>
All Answers
on the commandbutton add the immediate=true parameter.
<apex:commandButton action="{!cancel}" value="Cancel" immediate="true"/>