In Axapta 4.0, I have a grid with lines/records. The user can create records and change field values. When a field is modified, the form must change values on the current record and on some other records in the same form. And then it must refresh itself.
It works fine, except that when all that is done (from method modified() on the datasource field), then the form is refreshed and the focus jumps to the topmost record. (So for instance, when the user creates a record and enters 3 fields, then as the next field is modified, the cursor is suddenly on one of the old records and the new record is at the bottom of the grid.)
In order to simplify this, I have created a new table and a new form.
On the forms' classDeclaration, I have written this:
On one of the form's datasource field, I have written this:
public void modified()
myTableLocal = myTable.data();
myTable_DS.research(); // research and refresh are called from within the methods, my real program calls
On the form's datasource, I have made this method:
public void executeQuery()
myTable_DS.findRecord(myTableLocal); // just a test
it works if I hard code it in executeQuery, but when it go through modified, it forgets that I have called findRecord.
I really hope, you can help!