How to enable disable fields in forms in ax 2012

apply this code on the fieldĀ  which u want to make enable disable in the data source of the form

public void modified()

{

super();

if(enabledisabletable.ED == ED::Disable) //ED is a baseenum & disable is its element

{

enabledisabletable_ds.object(fieldNum(enabledisabletable,Name)).allowedit(false);

}

else

{

enabledisabletable_ds.object(fieldnum(enabledisabletable,Name)).allowEdit(true);

}

enabledisabletable_ds.refresh();

}

Advertisements