So I needed to disable a row in a Grid based on a value in one of the columns. I found an example on Microsoft’s website and wanted to document it here:
Overwriting the ‘active’ method on the datasource:
public int active()
{
int ret;
ret = super();
if (MDSI_ConfigurationLine.MDSI_ConfigurationLineStatusId == 'CLOSED')
{
MDSI_ConfigurationLine_ds.allowEdit(false);
}
else
{
MDSI_ConfigurationLine_ds.allowEdit(true);
}
return ret;
}
You need to make sure you have the else to allowEdit otherwise all of rows will be disabled.
2b8ab243-117f-4410-a959-2d83b2f3ca32|0|.0
Microsoft Dynamics Ax 2009