I am trying to avoid to create a js button, then I have applied the following pattern to have a custom button.
My aim now is to add a validation error if it is met a criteria dont allow the user continue with the button action,
I have tried
ApexPages.severity.Error but I have been not able to get it.
Can you recommend me it other approach?
What it should be the best way to achieve?