I have a Form which has a Button. Lets Say the Button name "EXECUTE_CO_CUST".

When I press the Button then it does few validations and if all of them are successful then the action completes successfully. I need a way where I can Disable the Button when i press it.(This should only happen when its fails the validations).

In simple terms if I press "EXECUTE_CO_CUST" Button then the Button should be disabled. How can I do that.

I tried using the below code in "WHEN-BUTTON-PRESSED" trigger:

set_item_property('BLOCK.EXECUTE_CO_CUST',ENABLED,PROPERTY_FALSE);

but its giving me the following error:

FRM-41032: Cannot set ENABLED attribute of current item BLOCK.EXECUTE_CO_CUST

Another option would be to create a Zero (0) second non-repeating Timer in your When-Button-Pressed trigger. This would ensure your button is only disabled when your specific circumstance existed. Here is a small example of how to use a Timer.