Notifications
Announcements
No record found.
Hi All,
I am having one requirement that I need to disable the new button after the save button is clicked. New and Save are standard system buttons in form.
Please guide me where i have to write code.
Thanks in advance.
HI,
If you hide the new button after saving it won't be available for next record creation. I mean it will be disabled all the time until you open and closes the form.
Can you elaborate what you want to achieve?
Thanks,
Girish S.
Hi, May I know why do you need to disable the New button. It's a standard functionality to create new records after saving current record. You can check Customer groups form.
Hi Girish,
Thanks for the response.
Actually what i want is after clicking new button,it should get disabled.
When the user click on save button at the time only new button should get enabled.
After saving record only ,user should able to click the new button,until the record is saved,user should not able to click on new button
Hi Mohit,
Thanks for your response.
Now its allowing the user to create multiple records,
we need to restrict that
For that reason we want to disable new button after save button clicked we can enable the new button again
Normally when you click on save button validateWrite method will be called and it will validate the current record and if it's an error it won't allow you to create a next new record otherwise it will allow you create new record.
This is how it will work.
If you want the user to won't allow to create next record without giving proper value on the current record you need to add validation for that. Trying to enable and disable a new button is not a good idea, I guess.
Whatever you are trying to achieve is not possible, I think.
JohnPaul,
Tell us the document where the record is being created.
Does the document have workflow enabled?
Does the requirement say, a Maximum of one record per user on the table?
If yes, you might consider indexes and disallow duplicate.
Disabling the "New" button to stop multiple record is not an ideal design.
Your requirement is still not clear, generally on click of New button, one record is created. Even if you disable New button and enable it on click of Save button, user still can create multiple records. How are you going to restrict it?
Hi PJ,
You can make it work by overwriting write() method of your data source.
Clicking button Save will call that method, and you can set 'allowCreate' to false to make button New disabled.
Hi JohnPaul,
Is there any business impact in case a user by accident clicks twice on the new button? Sometimes, I also do that, but can delete the wrong record. If there is no business impact, why adding logic to change the standard behavior of the application?
If you need to have a user creating one record at a time, you can consider developing a creation dialog instead, like the customer creation form, sales/purchase order creation dialog.
Thanks Andrew for your reply.
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 592 Most Valuable Professional
André Arnaud de Cal... 478 Super User 2025 Season 2
BillurSamdancioglu 305 Most Valuable Professional