Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Jump to a specific line/record in grid

(0) ShareShare
ReportReport
Posted on by 555

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:

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!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans