An event method sequence is executed when a form is opened. The specific sequence depends on the set of controls and data sources that are associated with the form.
Open a Form
In this example, the user opens a form that contains a grid control, which is bound to a data source.
The executed events are distributed across two threads. The timing of event method execution between threads can vary.
The following table shows the sequence that event methods are executed in when a user opens a form.
Method
|
Where
|
Thread number
|
---|---|---|
new
|
Form
| |
init
|
Form
|
1
|
loadUserSetting
|
Form
|
2
|
run
|
Form
|
1
|
init
|
Data source
|
2
|
executeQuery
|
Data source
|
2
|
leaveRecord
|
Data source
|
2
|
leave
|
Data source
|
2
|
leaveRecord
|
Data source
|
2
|
firstField
|
Form
|
2
|
firstField
|
Form
|
1
|
Most forms in Microsoft Dynamics AX are closed when a user clicks the Close button (the standard button in the upper-right corner of most windows). Some forms can be closed by clicking either an OK or a Cancel button. When the form is closed, event methods are executed.
Close the Form by Using the Cancel Button
When a user closes a form by clicking the Cancel button, event methods are executed in the following sequence:
Note
The FormRun class has the closed method and the closedCancel method. These event methods are not executed when the Cancel button is clicked.
When a form is closed with the closeCancel event method, the user's changes are not saved.
Scenario
This scenario uses a form that contains one CheckBox control as its only control. Assume that the CheckBox control is bound to a form's data source and that the control can update the data source.
Close the Form by Using the Close Button
When a user closes a form by clicking the Close button, event methods are executed in the sequence shown in the following lists. These lists are based on the previous scenario.
Following is the sequence of event methods when the form is closed—without the user clicking the check box.
Following is the sequence of event methods when the form is closed—after the user has clicked a check box.
Close the Form by Using the OK Button
Some forms can be closed by clicking an OK button. This leads to almost the same event method sequence as shown in the Close the Form by Using the Close Button section. The only difference is that clicking the OK button causes the Form.closeOK event method to be executed first.
For more details please check : https://docs.microsoft.com/en-us/dynamicsax-2012/developer/event-method-sequences-in-form-scenarios
|
1
|
No comments:
Post a Comment