Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have an opportunity page layout that has a custom button on it for feedback regarding that opportunity. If the opp stage ='won' we want to force the user to provide the feedback. This can be done by a validation rule easily enough. However the page layout with the error message that effectively says 'please provide the feedback' does not show the custom button, it just shows the Save & Cancel buttons. Can the custom button be put on this error message page as well so the user can click on it & provide the feedback and save?

share|improve this question
Where you put your button(hope this button is for provide feedback)? Do you have a VF Page on your layout or you are putting it under Custom Buttons section? – highfive Apr 3 '14 at 4:03
You cannot achieve that into a standard page layout. You could add some javascript hacks into the sidebar to actually catch the error and redirect the user to your feedback engine. But I don't advice to do that, not proper to Salesforce. – brovasi Apr 3 '14 at 4:35
The button is a Custom Buttom under the custom button section, when pressed it opens a custom VF page, but the button itself lives on the standard opportunity layout page. If brovasi is correct then it can't be done unless we write custom VF or code. – George Piumatti Apr 3 '14 at 5:27
Not clear. If the button lives on the standard layout and it's not what you need where you need the button to be? Some screenshots may helpful here – highfive Apr 3 '14 at 5:39
up vote 3 down vote accepted

You can't do this using standard pages in a supported way I'm afraid. Custom buttons don't show up on the edit page, and that page is pretty much uncustomizable apart from the fields and sections.

It is possible to add some JavaScript as an HTML area in the side bar and inject a button that way, but that is not supported by Salesforce and could break at any time. Its also fragile, in that you have to rely on certain styles, ids or elements being present on the page so if they change your code breaks.

You could put a feedback field on the opportunity and make the user fill that in when they edit an opportunity and change the stage to 'won', but you'd probably need another validation rule to stop people filling that field in when they shouldn't. Its not a great user experience but its the best that I've been able to achieve without resorting to code.

If you need to change the standard edit functionality, you'll need to go the Visualforce route I'm afraid.

share|improve this answer
Thanks Bob, not sure how to add a screen shot but yes when an error occurs, the screen that shows the error message only (presume thats the edit screen) has a save & cancel button on it only. So if fixing the error relies on pressing a button to do something then that button is not available from the error message screen. The user has to cancel to see the button again. – George Piumatti Apr 4 '14 at 6:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.