Understand on success
The actions that you define in the On success event will be executed when a new record is successfully submitted to the database or when an existing record is updated or deleted from the database. Different actions like Notification, Data access, Integration and Deluge can be associated with the 'On success' event.
Let's assume you have an OrderManagement application with an Order Placement form. You need to display a coupon code which the customer can use to get a discount on the next order. For this you can write a script for on success form event. This script will run on successful submission of the Order Placement form. In this case, when the customer successfully places the order, a unique code is displayed.