Notifications
Announcements
No record found.
Hi, I'm new to ax and in my current scenario While I'm trying to insert form fields data in datasource using buttons clicked method, instead of creating a new record its overwriting existing record
form pattern is dialog basic.
even after saving the property of a button
It sounds like your form controls are bound to a datasource but you didn't create a new record, therefore you're modifying an existing record. You can look into the debugger, for instance, to see whether it's the case. If you find out that it's true, you need to create a new record when running the form (FormDataSource has create() method for this purpose).
Can you help me with create() example to create new record insted of updating existing ones
It's very simple - something like myTable_ds.create().
I suggest you test it in a form with a grid; there you'll immediately see what's going on.
Do you have some code behind your button? Could you share it?
It's a command button, what command is it running?
no I have no code behind the the button @Nikolaos Mäenpää and actually due to diaglog basic its automatically taking as a Ok and cancel button
@Martin Dráb still its overwriting it
OK button is not expected to create a new record. Instead I would assume it to save the existing record. If you want a dialog that creates a new record you have to write some code. Check the standard forms such as SalesCreateOrder.
I'm sorry, but we can't find bugs in your code if you don't share it with us.
Also, did you follow my recommendation about how you can debug the behavior? If you did, you would surely know more than just "its overwriting".
there was no code behind controls.I have changed the form pattern It's working with another form format.Thanks, all
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 565 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader