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?
-
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?– highfiveCommented Apr 3, 2014 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.– brovasiCommented Apr 3, 2014 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 PiumattiCommented Apr 3, 2014 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– highfiveCommented Apr 3, 2014 at 5:39
1 Answer
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.
-
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. Commented Apr 4, 2014 at 6:44