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
Shawn ClarkShawn Clark 

Override Cancel Button in SF1

I build a custom controller extension, and simply want to override the action that occurs when the user hits "Cancel", but for some reason its not working. I can call the method from another Command Button (No Results Match) and it will perform this method, but I want to leverage the standard Cancel to set a couple parameters and move them back to the Main page. Any Idea why this isn't working?
public PageReference cancel(){  
       ShowMasterCreate = true;
       ShowConnectedCreate = false;
       PageReference pageRef= new PageReference('/apex/ContactSearchMain');
       return pageRef; 

User-added image



ShashankShashank (Salesforce Developers) 
I'm afraid we cannot override the Cancel button. However, please see if this blog helps: