Creating data-event handler methods
The data-event handlers handle the delegates exposed on every table. These delegates are listed under the Events
node.
Note
These events do not fire if the associated method (for example, insert
) is overridden on the table and super()
is not called.
How the event handler methods are organized is up to the developer; they just need to be placed logically so that others will find them easily.
In our case, the event handler is used purely for a report and populating a field on insert that is used in a report. So, we will place these methods in a helper class.
Getting ready
This recipe continues from the previous recipe.
How to do it...
To create a data event handler, follow these steps:
- Create a new
ConReportManager
class. - Open the table design for the table in question; in our case, double-click on the
SalesConfirmHeaderTmp.ConReports
table extension. - Expand
Events
and locateonInserting
.
Note
The onInserted
event is too late as we want to fill in a field before the...