web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Setting focus\highlighting particular grid row in dynamics AX

(0) ShareShare
ReportReport
Posted on by 110

Hi,

I have a requirement where I have to set focus (highlight) on a particular sales order record in the form's grid (FormB).

FormB receives salesId (of the recod to be selected) as an args parameter (from FormA).

I have written below code in FormB's init() method, but can't get it to work. Could someone please suggest:

public void init()
{
    SalesTable sl;
    super();
    sl = SalesTable::find('SO-XXXXXX');
  
    salesTable_ds.research();
    salesTable_ds.findRecord(sl);

}
 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Bashir Ahmad Profile Picture
    5,248 on at

    You can create an extra table buffer variable and fill it with the record you want to set focus on then run the following line of code: yourDataSource_ds.findRecord(yourNewTableBuffer); so if for example we are in SalesTable and yournewTableBuffer has the record with sales id: so_01122 then the grid focus will go on that record.

  • Verified answer
    Ivan (Vanya) Kashperuk Profile Picture
    Microsoft Employee on at

    findRecord() is one of the ways to go.

    You are using it a bit wrong however.

    You are trying to find a record in the datasource, which is right. But you are calling it too early, the data has not been retrieved yet (it happens in executeQuery() of the datasource)

    However, findRecord() is very slow, and Microsoft generally speaking considers its use a bad practice.

    Consider, instead, using the lookupRecord() method on the args class when calling FormB

    stackoverflow.com/.../dynamics-ax-2009-go-to-main-table-form-how-to-select-the-default-row

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans