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
Scooter429Scooter429 

Override Save Button on Standard Object

Is there any way to override the behavior of the Save button on a standard object (i.e., Opportunity)?  Basically we were planning on building an S-control that looks to see if an Opportunity (for a particular product type) is closed/won and if it is update a Boolean field on the Opportunity.  Unfortunately it does not look like it’s possible to override or hide the standard Save button.   Can anyone think of a work around other than outbound messaging to a hosted solution that will update the record via the API?  We are using SFDC Enterprise Edition.

Thank you,
Scott

Michael SnowMichael Snow
The only way to override the behavior of a save is by an apex trigger.  Apex trigger code is still only available to unlimited edition. 

I worked on an idea once that doesn't always work -and I will tell you the problems below- but you can add a hidden sControl to the page that checks to see if the case is closed/won, and if it is, update the check box. 

This normally works because after you save the opportunity it returns to view the page.  However, if you edit it from the tab, the save returns to the tab list and the sControl never fires.  Also, if the user is fast at clicking away from the screen, then the s-control doesn't have a chance to finish.  Besides those two glaring problems, it works pretty well.

Scooter429Scooter429
Thanks for the response.  I found the following request on the Idea Exchange.  I would encourgage anyone who is interested in seeing this addressed to vote for it.
http://ideas.salesforce.com/article/show/57023/Override_Save_Button_trigger_an_SControl_prior_to_Save