Note: Customize the frmCompany form window instead of
frmPersonInfo form window which is used for example above
Override a event handler implementation
Open frmCompany using View Code.
Go to the region Event Handlers and ensure you have the original
event handler cmdUpdatedCompany_Execute This is the one we want to override in our customized form.
Open frmCompany_Cust using View Design
Open the Designer for the commandManager
In the Available Command panel, select the cmdUpdateCompany
command and view its connected event handlers (Misc panel).
These are currently empty. The base implementation of frmCompany have
this command connected to the local event handler we found in the second
step above but the designer for frmCompany_Cust can not resolve,
showing an empty list. It will only show the local event handler for
frmCompany_Cust (which is currently none).
Double click in the Execute attribute to generate a new
event handler named cmdUpdatedCompany_Execute and add a
MessageBox to it, showing a message of your choice.
Mark the event handler with Override marker snippet:
Select entire event handler code -> Right mouse button context menu -> Surround width...
-> My Code Snippets -> IFS-APF -> LAA Override marker snippet and specify
the core event handler signature in it.
Open the Company window (Application Base
Setup\Enterprise\Company) and populate the form.
RMB click on the window header to open its Context Menu (menuFrmMethods)
Execute the menu option Update Company You should first see the message from the MessageBox, followed by
showing the Update Company dialog. This is due to having attached
another event handler to the command.
The event handlers are execute one by one, starting at the end (last
attached event handler is the first to be executed)
To break this "chain" of event handlers from being executed one by one,
change to the following code to the customized event handler: