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
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.
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.
That seems right.
Are you able to edit and save the data that are shown on the first tab page?
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.
Do you want to say that controls on the second tab aren't bound to any data source? Why?
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?
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156