Closing Windows in Dexterity



I am developing a Customization in Dexterity which consists of a functionality behaving like a wizard. I have thus created a Form having several Windows. I am trying to close and open each successive windows in the Wizard using the following code:


open window 'MySecondWindow' of form 'MainForm';

close window 'MyFisrtWindow' of form 'MainForm';


Meanwhile, when using these statements no windows are opened after executing the code.


Nevertheless, if I only include the first statement (i.e. open window 'MySecondWindow' of form 'MainForm';), the Second window does open, but the First window obviously remains opened.


I have also tried to hide the First window by using hide window 'MyFisrtWindow', but this also does not work (the window remains opened).


Thank you.