Hi Guys,
I have created a form where i need to enable / Disable some fields based on some conditions. Can someone clarify the below.?
I have two fields in a table called TestTable
Field A( Checkbox No/Yes), Field B (String). field B should be active for editing only if the Field A is selected
I set is as shown below, In the Form i added a SetfieldAccess method
public void setFieldAccess()
{
TestTable.object(fieldNum(TestTable, FieldB)).allowEdit(False);
if(TestTable.FieldA == NoYes:: Yes)
{
TestTable.object(fieldNum(TestTable, FieldB)).allowEdit(True);
}
TestTable_ds.refresh();
}
and in the active method of the data source
public int active()
{
int ret;
element.setFieldAccess();
return ret;
}
1. My problem here is whenever I selected the checkbox I need to either refresh the form or click on the field B or anywhere in the form to enable the field B active. its not refreshing automatically. how can I do that ?
2. Is above the proper way to set fields enable or disable in a form ?