I have a problem. When I carry out a transaction and that an error occurs, the window of the type "window" that I open at the beginning does not close when I close the error message.
From where is the form called? Can you describe the trigger workflow?
(something like " from OnPush I call Codeunit.run and within it I call FORM.RUN and after that....)
Yes, it is simple - because the Window variable you are using is global in the Codeunit, and the codeunit is runned through codeunit global variable, after the error the Window variable nor codeunit is cleared. You need to move the variable into some scope, which is not longer valid after the error. For example using local variable if possible, running the codeunit through "CODEUNIT.RUN(CODEUNIT::"xxx",Record)" or clearing the codeunit in some point... (Clear(AdjCBPost)).
Answers
(something like " from OnPush I call Codeunit.run and within it I call FORM.RUN and after that....)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
At the beginning of my Codeunit I call a window to follow the evolution of the treatments like that :
Then after several treatments, I close the window at the end of my code unit
If an error occurs and when i close the error message, the first window that i open to follow the transaction does not close.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
AdjCBPost is my codeunit.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.