Notifications
Announcements
No record found.
Hi Guys,
How to disable the button automatically,after the button is clicked once.
You can hook in the clicked method of the button. This way you can execute your code when the button is clicked.
Code for disabling a button would look like:
ButtonName.enabled(false);
Please note that you need to set AutoDeclaration to Yes for your button so that you can easily refer it from your code.
Hi jenifer,
What's your requirement?
Just writing an event post handler may not be enough. Does the status of the form change? Do you need to press the button when you open the form again?
If you need to determine the availability of the button based on states, you can code in the onactive() method of the data source.
Example-
I have "Submit" Button
when I click the submit button , it should be submitted only once and then the submit button should be disabled.
The button should be clicked once,not for the second time.
If it is a custom form, you can add an enum field to the data source and write in onactive() method of the data source(Code provided by Nikolaos).
You need to change the value of the enum in the button's onclick method and determine the availability of the button based on the value of the enum.
Hope this helps.
As Will WU wrote, you need to save information "Is this record submitted?" and use this information to enable/disable the button. Otherwise the button would be enabled if the user closed and reopens the form.
So, here's the solution:
1) Add boolean/checkbox field "Submitted" to your table
2) When the submit process is done (NOT when the button is clicked but when the process is really done succesfully!) update "Submitted" field to "Yes"
3) In Active method of your form data source, enable/disable the button based on the value of the Submitted field.
4) Set property "Auto refresh data" to Yes in your Submit button. This will make sure that the button is disabled once the submit process is completed.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader