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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Insert form data into database

(0) ShareShare
ReportReport
Posted on by 495

Hello experts,

I need some help in inserting data into my database from a AX 2012 form.

I have already created my table and form(notesform). this is what I have done....

1. created my table with two fields, Cusnotes and cusID. 

2. Create a form then add add a datasource with the two fields.

3. on my (notesform) I also add a commitbutton to click so the data can be inserted into the DB

I also have a button on my custtable form that chem I click it should launch my form(notesform)

FI now would like somoe help in inserting the data inputted on the form(notesform) into the DB. I want that when the form is launch it has the two fields and the button (Cusnotes, cusID and button)

whatever we type in the fields and then click the button it should get register in the DB.

Anyone, Please help me to achieve this. 

Thanks a mil.

*This post is locked for comments

I have the same question (0)
  • Lionel07 Profile Picture
    495 on at

    Hello Sukrut,

    Thanks for your suggestion.

    I think my post is not fully understood so am explaining what am trying to achieve.

    So I have created a table called CustomerNotes this table has two columns these are: CustomerAccount and notes

    CustomerNotes-->CustomerAccount

                             -->notes

    I then created a form to put the table on, the name of this form is customerForm

    what I need now is learn how insert input values from the form to the database.

    ie.... when a user launch the form with the two controls CustomerAccount and notes then click close or insert from another button then what data is entered it goes to the database.  

    Please note I would like to pick up the CustomerAccount from custtable which is in AX2012.  Your kind help please as am just learning these things.

  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Drag your table to the Datasources node of the form, then drag data source fields to the form design to create form controls bound to the fields. Then when your save the record (e.g. with Ctrl+S), it will be automatically put into database. If you want to add a custom button, use a Command button with the Save action.

    If your table has a relation to Customer (which it should) and you open it through a menu item button from a form with customers, the datasource will be automatically filtered.

  • Lionel07 Profile Picture
    495 on at

    7674.table.png

    Hello guys, I appreciate the support

    I have done all that was told but instead of a new record been inserted it is modifying the exiting record. How can this be fix?

    Here is a screen shot of my form..

    So my objective is to enter this  record into the Db not to modify what is there before.

    Again, thanks for the help

  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Sure, the usual behavior of forms is that they show existing records in database - and users create new records only when needed. But if you want, you can always create a new record when opening the form (by calling yourTable_ds.create()).

    But then you'll need another form for showing all notes for the current customer, which will likely render this form obsolete.

  • Lionel07 Profile Picture
    495 on at

    Sir Martin, understood and thank for your help.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans