order events are fired (single record form)

I have not been able to determine the answer to this question on my own…
Thank YOU to anyone who can shed some light on the order of events in this scenario…

condition: I have a single form with seven fields. The form is opened via menu. In the menu the sc_apl_conf() macro is triggered from the menu’s onExecute event to open the form to a new record. After the new user fills out the form and AFTER the onValidateSuccess conditions are met and AFTER the new user details have been written to the database, the form is then ready for a new record to be entered.

I’ve tried the onAfterInsert BUT the data was never written to the database (without using the header(refresh: 4).

Q: What event fires After the onValidateSuccess and before the form is cleared and ready for new data?

Thank you,
Stu Buck, Phoenix AZ

onBeforeInsert

Thanks Giu… That works.