Open Dialog/Window from a Form???

beno.pulverbeno.pulver Member Posts: 31
Good evening,

Since hours im trying and searching because of a problem with opening a dialog/window.

From a subform I call an own form, where the users can do selections with checkboxes. If they press the OK button, I execute the selection.
As there are many records to process, I thought to display a progress bar/window.

But now I get always the error "XY cannot be closed. because it is already locked by Microsoft Dynamics NAV"!?! I do not close my own form. But it seems, that the "WindosG.OPEN..." tries to close my own form.

If I do the same thing with a report instead with a form, then the progress window/bar is displayed without any problems.

Is there a restriction, that you can display dialog windows only from codeunits and reports, but not from a form???
Do you have any idea how to solve the problem?
Of course I could simply use a report instead of a form. But I would like to know, why it is not working with my form.

Best regards and thank you for any support, Beno

Answers

  • SogSog Member Posts: 1,023
    I believe the code of the dialog is in the wrong trigger. It might even be on the wrong form.
    So you call your ownform from a subform.
    The user checks one or more checkboxes and presses an OK button. Is that the caption of the button or is it an OK button: pushaction = lookupok?
    If it is the latter then pressing the ok will close the ownform. If you open your dialog when the user presses ok, the ownform can't close because the dialog locks it. I think you should fetch the checkboxvalues in you subform when the user closes the ownform and execute the business logic on the subform instead on the ownform.

    (this is heavily based on assumptions based on your description, but I'm guessing I'm not far off)
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • beno.pulverbeno.pulver Member Posts: 31
    Hi Sog,

    so stupid! You are completly right!!!

    The OK-Button wants to close the form, so a display of another window/dialog is not possible.
    After creating an own button without "PushAction = OK" everything works perfectly.

    Thank you very much, Beno
Sign In or Register to comment.