If we intend to trigger a piece of logic when a method is executed, we would usually use an event. This is not always possible, for example, when we need to hook into a method during its execution. For this, we will use
PurchTableType as an example, where the standard code synchronizes the delivery mode with the
tmpPurchTable table, which is within the Transport Management System (TRAX).
This table is created within the
insert method, and our example change is that we would reverse the vehicle service order flag if the delivery mode causes the standard code to select a carrier. The call stack for the standard code is as follows:
PurchLine.insert Calls PurchLineType.insert Calls PurchLineType.tmsModifiedDlvMode Calls ...