+ Start a Discussion

How to attach Code to Save Button - or equivalent solution

We have an S-control that initializes some fields of a newly created object.  It runs when the object is *displayed* after the "Save" button is clicked.

Unfortunately it does not run if the "Save and New" button is clicked, because the saved page is not displayed after that click.

How might we cause the initialization code to run no matter what?

Can we attach the code to the "Save" and "Save and New" buttons?

Right now, you have to be Unlimited Edition (you need Apex Code). Otherwise, you can't do anything with the save / save & new buttons.
~ sfdcfox ~
thank you very much for your kind and prompt as always advice!
Is this true of the Close button?

The close button can be overwritten.  You can find it by going to Setup | App Setup | Customize | Cases | Buttons and Links.