Do not use the gotFocus
and enter
methods.
Make a data source method to make changes:
void setAllowEdit() { salesTable_ds.object(fieldnum(SalesTable, Name)).allowEdit(salesTable.SalesType == SalesType::Journal); }
Call the method from the active
method:
public int active() { int ret = super(); ... this.setAllowEdit() return ret; }
Call the method from the data source field (in this case, the SalesType
field):
public void modified() { super() salesTable_ds.setAllowEdit() element.changeType();
source share