Page 1 of 1
Executing js code on exfmt
Posted: Tue May 21, 2019 4:05 pm
by DanWoitalla
I have some js code that I want to execute after an EXFMT. How do I do that? Sorry, I'm sure it's easy, but I can't figure it out - still relatively new to the tool.
Re: Executing js code on exfmt
Posted: Tue May 21, 2019 4:35 pm
by Scott Klement
You would either put the JavaScript code into an event in your display file, or write it as a function, and call the function from an event.
It's not clear what you mean by "after an exfmt", so I don't know which event to suggest.
If you want to run the code as soon as the screen loads, you'd put it in the "onload' event of the record format. If you want to run the code when the screen is submitted bacm to the IBM i, it'd run in the 'onsubmit' event, etc.
Re: Executing js code on exfmt
Posted: Tue May 21, 2019 5:02 pm
by DanWoitalla
Thanks - I got it. I put the js code on my record formats onload event.