Friday, September 23, 2011

How to enable and disable fields conditionally in Axapta Dialogs

Similar to forms, to enable and disable the fields conditionally in Axapta dialogs, the following steps to be followed:


1. In the class, declare the dialog variable as ‘DialogRunbase’




2. Override the dialogPostRun method in the class as follows:
public void dialogPostRun(DialogRunbase _dialog)
{
;

super(_dialog);

_dialog.dialogForm().formRun().controlMethodOverload(true);
_dialog.dialogForm().formRun().controlMethodOverloadObject(this);
}

3. Assuming the dialog field as fld3_1, override/create the method as follows:



To summarize the same, the ItemGroupId is the (fld3_1) field. Upon selecting the value in this field, the Division field should get disabled


2 comments: