1
votes

in lotus notes script i use a DialogBox to display a form where users put data.

But if the user press ESC keyboard button all data that user put in my DialogBox will be lost.

Is there a method to intercept when user press "ESC" button and save all data of the DialogBox form ?

1

1 Answers

5
votes

I would use QueryClose event on Form.

I see 3 ways how solve your task:

  1. Save data into User Profile (see more details here: GetProfileDocument)
  2. Save data into notes.ini (more details here: SetEnvironmentString)
  3. Add a validation on QueryClose that will ask User if it's OK to close Dialog dialog. Parameter Continue controls if Dialog can be closed or not.

See screen with QueryClose event below.

enter image description here

NOTE: if you want to have different behavior on if user clicked Cancel button and Esc than make Cancel as a custom button, so it first set some values to dialog and than fire closing, in such way on QueryClose event you will know how user fired close dialog event.