+ Start a Discussion

Throw error message before edit page from button

I am implementing a request to throw an error message to the user instead of going to the edit page if the object is in a certain status. My plan was to create a visualforce page and display the error if the object meets the criteria for the error message, and route to the edit page if not.

Is it possible to do this without the VF page, directly through the onclick javascript for the button click? How might I implement that? 

I just want to replace the standard edit button with a custom that would throw the error before the user gets to the edit page, instead of it throwing an error upon saving the modified data.
Hello James,

You can create a custom button and in onclick javascript, check the status and display error in Alert. If no error, redirect to the Edit page.