I have done a VF page in this pages controller. I have written a query to get some record. If the condition is false then an error message is shown. If the error message is shown then I want to disable the working of the save button.
Is it possible to enable the working of save button, or disable a save button? In Apex code.
The
disabledattribute of an<apex:commandbutton>can be set to enable/disable a button. Setting this attribute to a bound Apex variable would allow you to control whether or not the button is enabled in your Apex Controller or Extension.Example Visualforce markup:
Example Controller or Extension Apex code: