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)

When exactly does a form update a record (what calls write()?)

(0) ShareShare
ReportReport
Posted on by 2,007

I have a form question that I cannot find the answer to by searching the internet (I have a feeling it is because I do not know how to adequately construct the search query, but alas.)

I have a form with a grid that is pre-populated by data from a table. I have a quantity field in this grid that I want users to enter a quantity into. Let's say I have five records in the grid. When I enter the first record, it saves to the table just find when leaving the record via the tab key. However, if I attempt to modify the value in the field, it does not save the change when it is no longer the active record and the next record takes the value from the first record and makes it the default value for the second record (I would prefer it be 0). When I tab into the third record, the value in the first and third records becomes the value I just entered into the second record and the second record becomes blank, and again, none of them update the table with their new quantity value.

What am I doing wrong here? Can anyone point me in the right direction?

Thanks,

Brandt

*This post is locked for comments

I have the same question (0)
  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Brandt

    How many Form datasources are present?

    The Quantity grid field is a Edit Method ?

    Regards

  • Brandt Fundak Profile Picture
    2,007 on at

    Denis,

    There are 7 form datasources. This one is one of two the users can edit. The control is not an edit method--it is a reference to a Quantity field on the form.

    Brandt

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Brandt

    Thanks for your answer.

    This behaviour is typically related to the Datasource in Outer Join.

    How the Datasources are linked? Inner Join or someone in Outer Join?

    Also, the Grid Datasource is set with the "Master" Datasource?

    Regards

  • Brandt Fundak Profile Picture
    2,007 on at

    Denis,

    All of the datasources are inner joined. There are three sections of the form with grids--one section that joins the PmfProdCoBy table to the InventDim table, one section that joins the ProdBOM table to the InventDim table and the third section that I am having issues with--it contains two new tables I have created where one table (CutPlanTable) is the header, one is the detail lines (CutPlanLine) and the Lines table is joined to the InventDim table. The data source for the grid is the CutPlanLine table. When I attempt to enter values into the Quantity field on the CutPlanLine table is when I have an issue. I will say that I also have code in the the modified method of the the Quantity field on the CutPlanLine form datasource, because some of the other fields on the table have calculated values based on what is entered in that field. I tried to override the leave method of the datasource to have it call the write method, but that didn't appear to do anything.

    Any other suggestions?

    Brandt

  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi

    Try to change the Grid Datasource from CutPlanLine to CutPlanTable.

    Regards

  • Community Member Profile Picture
    on at

    I suggest if you verify the datasource of the grid in which the Quantity field is placed.

    What i think it should be CutPlanLine,

    I suspect it is not specified and may be it is specified as CutPlanTable

    Please verify and update with your findings

  • Brandt Fundak Profile Picture
    2,007 on at

    Dario,

    Your suggestion worked. The question I have now is why? Is it because CutPlanTable is the data source that the CutPlanLine and InventDim tables are joined to?

    Thanks for the help.

    Brandt

  • Suggested answer
    Denis Macchinetti Profile Picture
    16,444 on at

    Hi Brandt

    Simply, because CutPlanTable is the main (master) Datasource.

    Regards

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans