Hi all, Welcome back,
I am having methods for various fields and various objects.(i.e)
Table1.Field1:modified
Table1.Field4:modified
Table2.Field5:modified
Table3.Field6:modified
Button1:clicked
Button2:clicked
Here I have to call when the button clicked as like below codes. for Button1:clicked
public void clicked()
{
…
Table1.Field4:modified();
Table2.Field5:modified();
}
Please give the suggestions, how do we call.
Regards,
Rajkumar.G
Your question actually seems to be about how to get the object representing a form data source field. That’s the tricky part; calling the modified() method is then trivial. You can use the following piece of code after updating it with names of your data source, table and field:
myTable_ds.object(fieldNum(MyTable, MyField)).modified();
Another option would be extracting the logic to a separate method, either on the form or on the table. That would make calling easier, e.g. myTable.myFieldChanged().
If you want the same logic in all forms, you should place it on the table instead of writing it in each form. Tables have the modifiedField() method for this purpose, which accepts a field ID as its parameter (e.g. myTable.modifiedField(fieldNum(MyTable, MyField))). Again, you can extract the logic to separate methods and call them directly.