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)

Record not saved on form close

(0) ShareShare
ReportReport
Posted on by 3,945

hi

i have one grid through which i am taking multiple records from user and at the same time i need that record at run time only for some manipulation i mean before closing the form.

i have also tried this by making one grid with a new command button, whenever i click new command button the record is get saved in my data source table but the very last record is not being saved and i need that very last record also for manipulation before closing the form  

so suggest me what should i do 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    if you want to manipulate/ process records before closing forms, you need to override close method.

    expand form, go to top methods node, right click it and override method close, write your logic before super();

  • Gautam Profile Picture
    3,945 on at

    ok Sohaib

    in my case what logic i need to write in close() method so that the very last record of the grid will get saved there in my DS table

    give me some hints

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    Records are saved automatically - maybe you call your logic before the saving, or you have some other bug there. Unfortunately it's difficult to comment on code that you never showed.

  • Gautam Profile Picture
    3,945 on at

    hey martin drab you are right .

    records are saved automatically but as we all know it is saved only when we press close button of the form .

    am i right ??

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    It saved when you leave a record (closing a form may be one of many reasons for leaving a record), press a button or explicitly save the record.

    And now, please be so kind and explain your problem.

  • Gautam Profile Picture
    3,945 on at

    In my form there is a grid through which user enter the records .

    The last record that user has entered in grid is not being saved in my table , it will only save when i close the form but i don't want like this

  • dolee Profile Picture
    11,279 on at

    Hi Gautam,

    Then what exactly should trigger the "save" action for your user?

    Normally it's "leaving the record" like Martin suggest that triggers the saving action. In other words, "closing the form" or "move to another record" will save that record.

    If that's not what you want, please let us know the new criteria you wanted. And please tell us what problems you are having implementing the new criteria.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    I mean explaining your implementation, not just  repeating that "it's not saved". All waht I can say from your description is that your implementation is wrong, but it's impossible to say anything more specific. If you want any help, you'll have to do your part first.

  • Gautam Profile Picture
    3,945 on at

    ok . i think my implementation is wrong

  • Community Member Profile Picture
    on at

    Hi Martin,

    I've been following this post and I think I understand what Gautam wants to say as I have the same question.
    I am aware of the fact that the user saves the data in the data-source table when he moves to another field in his form.

    However, when the user reaches the last field in his form and fills that field, it is unclear if the field in the data-source table will be saved when the close button is clicked.

    Personally, I've overridden the clicked method of the button that closes the form with the

    element.closeOk();


    method added before the super() method.

    The code in my clicked() method looks like this:

    void clicked()
    {
        element.closeOk();
        super();
    }


    I am not sure if the element.closeOk(); method should also save the last field filled in the form.

    Thank you for your efforts to 'illuminate' us :)

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
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans