On Closing Form

Kc_Nirvana
Kc_Nirvana Member Posts: 146
I have a form list which can modify values.
If I press the close button (x button on form) I want to cancel the changes made.
It is possible?
Junior Consultant & Developer in Dynamics NAV

"I'm worse at what I do best
And for this gift I feel blessed
Our little group has always been
And always will until the end"

Nirvana - Nevermind - Smells Like Teen Spirit

Answers

  • DaveT
    DaveT Member Posts: 1,039
    Hi,

    Nav updates the values real-time (or least when you navigate off a record). To acheive what I think you want - you will need to use a temporary table.

    1. Fill the temporary table
    2. Write changes from temporary table to "real" table when OK/Finished pressed
    3. No code needed for cancelling as the temporary table is deleted from memory
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Kc_Nirvana
    Kc_Nirvana Member Posts: 146
    I am very newbie.....
    How can i create tables temporary?
    I ve seen a property on the form to use that but if i select that i don't see any value
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • DaveT
    DaveT Member Posts: 1,039
    Hi,

    Yes, the property is what you need. So to get you the background. When you set the form to run from a temporary table (or if you are using a temporary table record variable) the then system creates a copy of the table in memory. This starts as a blank table so you will need to write code to fill the table. The user can then edit and the changes are made to the table in memory. To save the changes, you will then need to write code to update the "real" table.

    Hope this helps.
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • Kc_Nirvana
    Kc_Nirvana Member Posts: 146
    :thumbsup: Thank you very much
    Junior Consultant & Developer in Dynamics NAV

    "I'm worse at what I do best
    And for this gift I feel blessed
    Our little group has always been
    And always will until the end"

    Nirvana - Nevermind - Smells Like Teen Spirit
  • DaveT
    DaveT Member Posts: 1,039
    Glad to Help :mrgreen:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html