Say you have a popup EP page that you are using to create new records. You want to add a Save button, which when press will save the record but will not close the form (a keepDialogOpen behavior).
Basically the form will close if you're going to do an AxForm.DoSave() or will create a new record if doing an AxForm.InsertItem(true). Of course, the form is set to DefaultMode="Insert".
What I discovered to work in this case are the following lines of code: