Form Events - Load?

Greetings. We are pleased to have matched some work to this great tool.

The docs identify these Form events:
onhide()
onkeypress(event)
onshow()
onsubmit()

What about an onload() event?

I need to make several service calls to retrieve data and load into controls. For now, I will put those in onshow(), but, I only really want to do that once, not every time I ChangeForm back to the form. ?

Thanks.

Hi Guys,

All appreciated. So glad to be in such a network…

Thanks,

Deniz

Go to Project Explorer > Right mouse click Project Properties and Global Code > Place your code there. Whatever you place there gets loaded once.

There is an external code.js file that gets created appended to the final index.html file.

@FrankR, you’re correct, there is no Form onload() event (nor unload()).

What I do is put it in the form’s onshow() function, so it only gets run the first time it is called:

Form1.initDone = false;

Form1.onshow() = (() => {
  if (Form1.initDone === false) {
    // do my form load stuff
    Form1.initDone = true;
  }
// do my form show stuff
)} 

The best place for this is on the form’s code window.

1 Like

I don’t know how I missed this. Just catching it now. Thank you.