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)

How to update database from a form in AX 2009

(0) ShareShare
ReportReport
Posted on by 790

I'm new to X++ development.  I have done several ASP.Net projects using the AX .Net business connector but this is my first attempt at true X++ development.

So far, I have created a form with 2 tabs.  The first tab has a grid control which displays all rows from my table WfsProd.  I can then select a row by clicking it and then click my second tab which displays this row with each field in a stringedit or realedit field.  So far, this all works.

But now I want to let the user change any of these fields and save it back to table WfsProd.  This is where I need help.  Can't seem to find any web sites that explain how to do this.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    Basically you should have your WfsProd table as a datasource on the form, and the you can drag fields from the datasource into the design parts, for example the grid. That's it.

    You might want to look into if the table has the "AllowEdit" property set to No, either on the table itself or the form datasource if you cannot edit the fields you already have.

  • Robert Herrmann Profile Picture
    790 on at

    I already have the grid populated from the datasource which is based on table WfsProd.  I then highlight a row in the gird and click on my second tab named Details.  I now see all my fields as textboxes or dropdownlists.  Now how do I allow changes to be made to this data and how do I save the changes back to the WfsProd?

  • Martin Dráb Profile Picture
    239,381 Most Valuable Professional on at

    Do you want to say that controls on the second tab aren't bound to any data source? Why?

  • Robert Herrmann Profile Picture
    790 on at

    The StringEdit and RealEdit fields on the second tab are bound using the same data source as the grid.  Maybe this is incorrect.  I really do not know how to do this and that is why I am asking for help.

  • PA-22040759-0 Profile Picture
    6,194 on at

    That seems right.

    Are you able to edit and save the data that are shown on the first tab page?

  • Robert Herrmann Profile Picture
    790 on at

    I just tried that.  I clicked on one of the string values and I was presented with a dropdownlist.  I clicked on a different value and then got this error:

    "Error executing code: WfsProd (table) has no valid runnable code in method 'validateField'.  (C)\Data Dictionary\Tables\WfsProd\Methods\validateField(C)\Classes\FormStringControl\Modified"

    I get this error as soon as a click a new value.  Actually, this is the also the same error I get on the Details tab when I try to change a value of a field.

  • PA-22040759-0 Profile Picture
    6,194 on at

    Allright, your form is probably ok. But you have a compilation error in a method on the table.

    You must go to the Data Dictionary\Tables\WfsProd\Methods\validateField method and figure out what's wrong with it. This method is called every time you modify a field on this table from any form.

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
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans