The AfterClose event occurs when the window closes. It occurs after the Microsoft Dynamics GP window close event.
window_AfterClose()
• window – A window object.
Microsoft Dynamics GP typically uses the window close event to check for any unsaved changes, or whether the user entered all required fields in the window, and display the appropriate dialog.