Develop Code to Extend a Framework – Event Handlers

Some elements, like tables and forms, contain an Events node in the designer window that, when expanded, lists all the events that are associated with that element. If you need to add supplementary behavior that doesn’t currently exist in an element, you should create an extension of that element, and then add an event handler to the extended element.

The following are methods for event handlers that are pulled from the CustTable table. These methods can be copied and added to your extended element or class by right-clicking the event in the element designer window and selecting Copy event handler method.

  • OnDeleted event – This is a post-event handler that triggers when a record is deleted in the table. You could use this, for example, to display an Infolog message after a record is deleted.
  • OnInserting event – This is triggered when data is being inserted. For example, this could trigger when you add a new customer to finance and operations apps.
  • OnValidatedWrite event – This is a post-event handler that triggers after data is entered. This is used to validate data that is being written to a page, such as ensuring that a customer is at least 18 years old by verifying a birth date.