Go to specific line in grid

MortenSteengaard
Member Posts: 144
Hi experts,
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:
myTable myTableLocal;
On one of the form's datasource field, I have written this:
On the form's datasource, I have made this method:
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!
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:
myTable myTableLocal;
On one of the form's datasource field, I have written this:
public void modified() { ; super(); myTable_DS.write(); myTableLocal = myTable.data(); myTable_DS.research(); // research and refresh are called from within the methods, my real program calls myTable_DS.refresh(); if (myTableLocal.RecId) { myTable_DS.findRecord(myTableLocal); } }
On the form's datasource, I have made this method:
public void executeQuery() { ; super(); if (myTableLocal.RecId) { 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!
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions