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
saracsarac 

Save override in Extension not working

So I am trying to override the save function in my extension class to avoid some of the required field validation. These are not required fields in the custom object, they are required in the VisualForce page with the attribute required=true in the apex tag.
 
I currently have a method which is doing NO saving, yet save() in the standard controller is still obviously being called because i am getting errors about required fields. Literally, the method is all commented out and no save or anything else is explicitly being called.
 
Do I need to just name the method something else and not technically override it? Attach the new method to my VisualForce button?
 
Currently I am using public PageReference save() as my overriding function. Is there some sort of implicit super() being called? I thought you needed to explicitly call the stdcontroller.save() for that to happen.
 
Thanks!
Sara
TehNrdTehNrd
When you add the attribute  "required=true" that means really required and the page will not make calls to the controller unless then are filled in. I think you can excluded these by using the action:region tags but I am not positive.
saracsarac
I just figured that out finally, that the controller is not even called unless required fields are filled in.

Thanks!
sara