web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

insert form field data in datasource using button clicked event

(0) ShareShare
ReportReport
Posted on by 135

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

3755.png2451.png

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    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).

  • athombare Profile Picture
    135 on at

    Can you help me with create() example to create new record insted of updating existing ones

  • Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    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.

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    Do you have some code behind your button? Could you share it?

    It's a command button, what command is it running?

  • athombare Profile Picture
    135 on at

    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

  • athombare Profile Picture
    135 on at

    @Martin Dráb  still its overwriting it

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    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.

  • Martin Dráb Profile Picture
    237,884 Most Valuable Professional on at

    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".

  • athombare Profile Picture
    135 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans