Run Query close event in dialogbox form depending on whether OK or Cancel button is clicked

I have a dialobox form and there is a code in Query close event of the form. I want this query close in dialogbox to run only if “OK” button in dialogbox is clicked. If Cancel is clicked I want to ignore code in query close event. Is is possible to do without hiding the default OK,Cancel buttons.

Thanks,

Vishu

Subject: Why not just check to see which button was clicked and only run the code if OK was clicked?

Subject: The OK Cancel buttons are default buttons. I do not know how to check which button is clicked

The OK and Cancel buttons in dialogbox show up by default. I do not know how to figure out which button is actually clicked. If I had a button in mainform which opened the dialogbox, I could have checked if dialogbox as cancelled, but I want to run query close even in the dialogbox form itself and based on whether ok button is clicked or cancelled is clicked I want to run specific code in query close event.

Subject: Uh?

Look at DialogBox method in the Domino Designer Help, look at the examples, try the samples, read it.

Return value

flag

Boolean. Returns True if the user clicks OK in the dialog box. Returns False if the user clicks Cancel.

Subject: I know dialog box call returns true, false, but my question was how would I run a query close event in the dialogbox form

Hi Carl,I do know how the dialog box runs and I did read the help. I know if you call a dialogbox from a button on a main form, you can check to see if a dialogbox was cancelled, but my question was not that. I was asking if I can run query close event in the dialogbox form based on which button was clicked (OK, CANCEL).

Thanks,

Goutham

Subject: In that case what Phil said.

Subject: A solution (I hope)

What you will need to do is create your own “OK” and “Cancel” buttons, with the relevant LotusScript behind them to carry out whatever you want to do for each option.

Then at the bottom of the first tab of the button properties in Designer, you need to set the button “Type” to “OK” or “Cancel”, for each button.

You will also need to change your ws.dialogbox options so that you do not display the default OK and Cancel buttons.

Hope this helps,

Phil

Subject: DialogBoxCanceled

I think you can check in QueryClose Notesuidocument.DialogBoxCanceled property:

"

True indicates that the user exited the dialog by clicking Cancel or pressing ESC.

False indicates that the user exited the dialog by clicking OK.

"

PS: I know it’s a late response but maybe help also other people