Prevent unloading

Hi

We have two forms which should not become unloaded. I read in the forum that I should store a reference to the form in a global. This is what I do on load of the application:

globals.myVar = forms.FormWhichShouldNotBeUnloaded;

But nevertheless, after running the application for a while, the form will become unloaded. Why? Do I store the wrong value? Can I prevent this even better in the onUnLoad method catching the appropriate event?

Regards
Birgit

hi Birgit,

I think you set the global too early, when the form is not even loaded;
what if you set it on form load ?

Doesn’t it get loaded when I reference it?
But I’ll give it a try.
Thank you for the hint!

Kind regards
Birgit

No I do store the form on load:

function onLoad() {
  globals.basRegistration = forms.BasRegistration;
}

Still I get the error, the forms will still become unloaded after a while. Any other ideas? Please, I need to guarantee the forms do not get unloaded.

Regards
Birgit

hi Birgit,

it is a bug that is fixed in the next releases.
at this time, only forms that has references in global arrays are not unloaded.

Ah, yes, with an array it works! :D
Thank you.

Regards
Birgit