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
SFDC n12SFDC n12 

Overriding standard "save" button on opportunity with a popup message

Hi,

I am trying to overide the standard save button on opportunity object with a popup message when the following condition is met 

opportunity stage ="closed lost" 

please let me know hw to proceed on this 

help me with the code

Thanks
Offshore Freelance ConsultantOffshore Freelance Consultant
Hi,

It depends on what you want to do when the condition is met.

If your requirement is to display just a message, then go for validation rules.

you cannot remove standard save button from page layout. If you are particular about having a popup message, you have to build a visual force page that displays the opportunity page without standard save button and with a custom save button. You can write any code you want on the click event of the button using javascript(actionfunction?)

Hope this helps!
JG
Ramu_SFDCRamu_SFDC
You might have to look at the below posts that has the sample code on how to override standard save button

https://developer.salesforce.com/forums?id=906F000000096PfIAI

The below post has the code to get the confirmation popup

http://salesforce.stackexchange.com/questions/2046/how-to-add-a-confirm-dialog-to-a-command-button