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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Form grid position to record is not working

(1) ShareShare
ReportReport
Posted on by 629

I have a new simple list form that is opened to show all records from a list page.

When open the form, it is always show first record but not the selected record from the list page 

The datasource in new form set as tmp let say is MyTable, when the form opens I want to set like below 

MyTable selectedBuffer;
        
select firstonly MyTable 
    where MyTable.RefRecId == element.args().record().RecId;
    
selectedBuffer.data(MyTable);
MyTable_ds.positionToRecord(selectedBuffer);

I have try above code in datasource init but it's not working. In the executeQuery, the form open with the selected record only

How can i open a form with all records and the cursor is highlighted in the selected record from previous caller ?

I have the same question (0)
  • Martin Dráb Profile Picture
    239,747 Most Valuable Professional on at

    Why exactly do you select data from MyTable and then pass it to selectedBuffer? Couldn't you simply do this?

    select firstonly myTable 
        where myTable.RefRecId == element.args().record().RecId;
        
    MyTable_ds.positionToRecord(myTable);

    Does it make a difference? I've never tried it, but the fact that you're using non-temporary buffer (populated with data()) to find a record in a temporary table may be a source of problems.

    Also, init() may be too early. What if you do it in run() instead?

  • tyhj Profile Picture
    629 on at

    Yes init() maybe too early. I use a buffer hoping I can get the result I want. But seem like no difference. The code and my previous code give the same result, under form run() method, it will open only one record (selected record).

    Also I try to add the caller table as a datasource in my new form, the new form is also filtered to the selected record only.  

    I suspect temporary datasource does not support the positionToRecord / findRecord method ? Is there any other way to do this ?

  • ToddB Profile Picture
    Microsoft Employee on at

    Hi SLC,

    Were you able to resolve the issue?

    Not sure if the below thread helps:

    Form datasource find record method

    community.dynamics.com/.../form-datasource-find-record-method

  • Martin Dráb Profile Picture
    239,747 Most Valuable Professional on at

    findRecord() is deprected, it was replaced with positionToRecord(). Source: Deprecated APIs.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 566 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 504 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 429

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans