When defining a form, you can also define processing to run as the form is being opened (pre), as it is being closed (post), or if the user cancels the operation.
About Form Processing Pre-Process URL for an Editable Form Page Pre-Process JPO for an Editable Form Page Cancel Process URL for an Editable Form Page Cancel Process JPO for an Editable Form Page Post Process URL for an Editable Form Page Post Process JPO for an Editable Form Page Passing Field Map Information to a Custom JPO Configurable Form View of Multiple Rows and Columns with programHTMLOutput