I have a question about how to implement this code
public void setFieldAccess()
{
if(HcmWorkerBankAccount.FullAmount == NoYes::Yes)
{
hcmworkerbankaccount_ds.allowedit(false);
}
else
{
hcmworkerbankaccount_ds.allowedit(true);
}
}
credit: http://axhelper.blogspot.com/2011/02/to-disable-record-in-form-by-unchecking.html
It says to create it on the form’s methods and call it in the datasource’s active method and field’s modified method. I am assuming this is the field in the datasource, not on the form design.
My question is if this is how I call the method:
public int active()
{
int ret;
element.setFieldAccess();
ret = super();
return ret;
}
public void modified()
{
element.setFieldAccess();
super();
}
First off, your method is too verbose, this is the way to put it:
Also, call the method after the
super()call: