GotFocus and enter the methods in the Form field, which is not called

I have several fields in my sales order form (SalesTable) that need to be disabled if another field is set to a specific value. To do this, I tried the input methods and gotFocus in the form field (I did this for verification). The code compiles and does not contain any problems.

My problem is that none of these overridden methods are called when I click on a field in the corresponding grid column. What will call the input method and gotFocus method in the grid field?

+6
source share
1 answer

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(); // standard code } 
+8
source

Source: https://habr.com/ru/post/908516/


All Articles