0

Whenever I click the (X) button on my form, it still keeps the data. I want to be able to close the form using the (X) button and not save any data. Does anyone have an idea of why is this happening?

Scenario:

Form1 has a button [enter car information] when I click the button, another form opens, Form2, where I can type all the car information. Once I click OK button, Form2 closes and Form 1 gets updated with Form2s information.

My problem:

If I click the X button on Form2, Form1 still updates with Form2s information. Is there a way to prevent this?

Thanks for all the help!

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
JoseStack
  • 167
  • 2
  • 12
  • I think I found a way to solve this. If I create a condition where I check that the OK button wasn't pressed or the cancel button wasn't either, then it means that the close (X) button was pressed. All I had to do was to put this condition before updating Form1. `if (!Form2.closedCancel() && addressForm.closedOk()) //OK clicked updateForm1(); else don'tUPdate' // OK button,cancel button not clicked` – JoseStack Jan 04 '16 at 15:08

1 Answers1

0

It is the way AX is designed. Pressing 'Esc' key or 'Ctrl+Q' will quit without saving or ask you if you want to save your changes. But it will be only for the latests.

Geoffrey DELMEE
  • 772
  • 4
  • 8