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 :
Microsoft Dynamics AX (Archived)

Form DataSource data loss

(0) ShareShare
ReportReport
Posted on by

Hello,

I've been working on Microsoft Dynamics AX 2012 for a full month now and I encounter strange bug. I've created a table which is set as a DataSource for the form which was also created by me. I add some data from form to table with the command button (Command: New), it saves most data properly when I check in table later, but sometimes (approximately 1 out of 5 times) it sets the Quantity field (EDT created by me, extends integer) to zero.  The next time I try to create exactly same data to table, it will most likely do the job right (same probability of data loss).

I've tried to delete all data from table and synchronize several times, but it didn't help. I've tried to use debugger as well, but as far as the scope for this variable goes, it shows the right value, then it jumps to some formRun methods, where Quantity variable is not present and when it finishes it may or may not show the right value.

Any suggestions with my problem?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Hi Proofessor,

    Have you overwrite any methods in table or at form's datasource? Inserting records in a table which is being used as a datasource in form does not require any coding unless you really have to put some custom logic e.g. default some values in initValue method. Otherwise it is a very straightforward way without any code.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    If you just want to save field values in a table, and you talk about variables, you probably have implemented it incorrectly. You must set the datasource and datafield properties on the form control, which will make it a "bound control". Saving and storing the values will be handled by the AX kernel automatically, correctly - there should be no data loss for sure. You could override the insert and update methods on your table, and put breakpoint on those to debug if you have the correct values on object "this", which will be your current table.

  • Community Member Profile Picture
    on at

    Yes, I have overriden executeQuery to apply queryRange for some sorting, but I don't update any data in this method, so it still doesn't explain data loss.

    This quantity field was added to table after it was set as form data source so now I am just synchronizing whole database, so that it can hypothetically improve the situation.

  • Community Member Profile Picture
    on at

    Vilmos,

    Can't say that problem is solved yet, but debugging table methods instead of form methods was a good approach, thanks for the advice.

  • Verified answer
    Community Member Profile Picture
    on at

    Well, global SQL database synchronization solved the issue, I guess it was one of those bugs which shouldn't even appear in the first place. If anyone see something acting unusual like this, perhaps you'd better try synchronization.

    For the synchronization, you can follow this steps:

    technet.microsoft.com/.../aa548671.aspx

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans