This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
The formRun() object doesnt have modifyDialogFields() method when trying it out |
|
|
|
|
|
|
|
Consider the following scenario: In the dialog of a SysOperation construct, a field must be manipulated depending on other fields, for example, the AllowEdit property should be changed.
In the following you will find the code for a DataContract and the corresponding UIBuilder, in which the corresponding program logic is to be installed.
Here, depending on the selection in the Module field, you can either activate the Customer account field or the Vendor account field.
DataContract
UIBuilder
The methods generated by the framework are made accessible in the method build().
This is the first time the modifyDialogFields() method is called, so that the property of the desired field is changed immediately, when the dialog is opened.
In the postRun() method, the modify() method of the module field is overridden.
In this overridden method, we call the modifyDialogFields() method. Here, it is important that the method obtain the correct parameter profile and return the expected AX data type.
The "magic" goes through the modifyDialogFields() method. The fields are enabled or disabled, depending on the value selected in the module field.
Of course, many other properties of dialog boxes can be changed dynamically in the same way.