Close form and tab in events OnAfterInsert

In the form application, I use the js button to exit the application and close tabs.
The code is from forum as follows:

parent.del_aba_td(‘item_70’);

and works OK.

But ??
Is there any chance I could use the same in the OnAfterInsert events
to close the form and tab?
This syntax does not work in OnAfterInser because it is not correct.

I know the sc_redir option, but it doesn’t close the tab.