Before/After Events
Trigger Setup
In this sample, we will look at the types of events available for each of the controls mentioned below.
Text Box Events
Button Events
Grid Events
Within each event mentioned below, there will always be a Before/After version.
What this means is how the event fits into the existing Core logic of the control. For example, if one needs to have a script run when tabbing off a Text field and core logic also runs when tabbing off the field, the before and after events define if the custom script should run before/after the core logic.
This can be seen much like a sandwich, VB Before – Core Code – VB After.
If you don’t like reading, you can watch the video.
Try it!
Text Box Events
All text boxes will have the following events from the Events drop-down list.
Basically, there are 3 events, with a before/after derivative of each.
Lost Focus – This is fired when the operator Tabs off the text box.
Got Focus – This is fired when the operator clicks into the text box. (OR the system moves focus to the text box as part of its process)
Validated – This is like Lost Focus but is fired before the Lost Focus event. (This is useful if the core system is using Lost Focus for some logic, and we need to get into that process first)
Button Events
All buttons will have the following events available from the Events Drop down list.
Basically, there is only one event, with a before/after derivative of each.
Click – This fires when the operator clicks the button.
Grid Events
All data grid controls will have the following events in the Events Drop down list.
Basically, there are 4 events, with a before/after derivative of each.
CellButtonClick – If the grid contains a Button in the cells, this is fired when clicking on these buttons.
Refreshed – Fired when the operator refreshes the data grid.
ExportToExcel – Fired when the operator clicks the “Export to Excel” button on the top right of the data grid.
ExportToPDF – Fired when the operator clicks the “Export to PDF” button on the top right of the data grid.
Let’s review sample Scripts of how other functions within VBScripting works - Button/Process Blocking