function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
dgindydgindy 

PageReference( ) and required Field

I have a page where I'm trying to leave the page on a cancel button but the required field wont let me. Any ideas?
Code:
public PageReference Leave() {
        string x = ApexPages.currentPage().getParameters().get('DoctorId');
        PageReference pageRef = (new PageReference('/'+x));
        pageRef.setRedirect(true);
        return pageRef;
    }

 
Thanks
jwetzlerjwetzler
Please refer to the immediate attribute on commandButton / commandLink.