Add BeforeUnload event

I discovered that - for some reason - doing an sc_redir after an AfterUpdate event seemed to prevent the preceding code from executing.

If found this post:

YES…
you may not use this in onafterupdate event…

You have to define in application link - propertiers , that the form is closed after update.

SC behavious other in onafteradd event. There you have to use sc_exit(sel)… Funny
it’s not logic… but SC

And discovered that unless you want to do conditional redirects, it is best to do your form redirects via Application | Navigation (Exit Application = Yes and Exit URL = your desired redirection location).

My suggestion would be to have a new event that fires after AfterInsert, AfterUpdate, AfterDelete and is BeforeUnload i.e. before the form unloads
This would be the very last bit of code to fire after all the AfterInsert, AfterUpdate, AfterDelete fire and so you could avoid duplication of some code and get round some of the apparent restrictions of redirects that I came across.

Best regards
Uwe

Re: Add BeforeUnload event

Hello andy,

This would save a lot of time. I will report this suggestion to our development team.

regards,
Bernhard Bernsmann