We could use the debugger to trace through the events the system calls as part of handling the form. This can be difficult at first as the code jumps between methods on the form and the FormRun
framework. We can also do this by simply overriding the key methods and displaying an info log message.
The command to display an info log message is info("Message to be displayed")
.
We will override the methods called by the event by adding the info
command after the call to super()
, as highlighted in the following lines of code:
{
super();
info("<message>");
}
As this method is overridden from the base class, AX automatically adds a line to call super()
. This will call the base class' method, executing the code that would have normally run. We would not normally remove this line in the case of forms and framework classes as it can produce unexpected and undesirable results.
To create the demonstration, follow these steps:
ConFMSVehicleGroup
form. This is done by right-clicking on the form and selecting Duplicate.ConFMSTest
.super()
method call, add the following line:info("Form init called");
super()
call, add the following line:info("Form run called");
super()
call, add the following line:info("Data source write called");
super()
method call, add the following line:info("Data source field description modified");
super()
call, add the following line:info("Form control Grid_Description modified");
Form init called Form run called
Data source field description modified Form control Grid_Description modified
Data source write called
These events also carry on to the table, as shown in the following simplified diagrams:
To delete the form, simply right-click on the form and choose Delete. If this is done from the project, we are asked if we wish to remove the object from the project or delete it. In our case, we wish to delete the object.
18.227.10.66