Form Method Sequence

Dynamics AX 4.0

The calling sequence when data is modified through a control on a form is top down: first, the methods on the control are evaluated, then the methods on the data source, and finally the methods on the table.

This means that when a control is exited the following methods are activated

Method

On the

Comments

Leave

form control

Here, you can only use the property system to get the value.

The method is always activated when you leave a control.

Validate

form control

Here, you can only use the property system to get the value.

The method is activated only if the user has edited the contents of a control.

Modified

form control

Called if Validate() on the control returned true. The call to super() calls the Validate method on the form data source field (if control is bound to a field). After super() the field in the current record will hold the new value.

Modified is activated in the following situations:

  • When an edit field (one of the following controls: StringEdit, IntEdit, RealEdit, DateEdit, or TimeEdit) is exited.

  • When a selection in either CheckBox, RadioButton, ComboBox or Listbox is changed.

The method is activated only if the user has edited the contents of a control.

Validate

form data source field

Method is called from the super() call in the Modified method on the control. The call to super() calls the ValidateField method on the table.

The method is activated only if the user has edited the contents of a control.

ValidateField

table

Called from the super() call in the Validate method on the form data source field.

The method is activated only if the user has edited the contents of a control.

Modified

form data source field

Called from the super() call in the Modified method on the control.

The method is activated only if the user has edited the contents of a control.

ModifiedField

table

Called from the super() call in the Modified method on the data source field.

The method is activated only if the user has edited the contents of a control.

If all the validate functions return true, the field in the current record is supplied with a new value. The value, however, is not written to the database before the record is saved (by moving to another record or pressing save). When saving the record to the database, the ValidateWrite methods are called.

If any of the validate functions returns false, the field is not supplied with a new value.

Community Additions

ADD
Show: