Hi Guys,
How to disable the button automatically,after the button is clicked once.
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.
Hi jenifer,
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.
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.
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.
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.
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 Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,257
André Arnaud de Cal... 913 Super User 2025 Season 2
Sohaib Cheema 611 User Group Leader