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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Form datasource cursor resetting to first record on refresh

(0) ShareShare
ReportReport
Posted on by

I have a requirement where I have to display CostCenter from financial dimensions from purchase order header on the grid of "All purchase orders" and it must be filterable.

For this I made a custom view to get CostCenter for each purchase order and added it as a datasource on the form (PurchTable) with Inner Join with table (PurchTable). It worked as expected except one issue that the cursor goes back to the last record on refreshing the form.

The form itself works fine if I remove my custom data source. So, as per my findings View as a datasource is causing the cursor to reset to the last record on refresh but I don't know why its happening and how to fix this. 

Any help is appreciated.

I have the same question (0)
  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at
  • m.kamal Profile Picture
    on at

    Hi, thanks for the links. I found the following solution from there and it works.

    public void executeQuery()
    {
        PurchTable purchTable = this.cursor();
        RecId purchRecId = purchTable.RecId;
    
        next executeQuery();
    
        if (purchRecId)
        {
            purchTable = PurchTable::findRecId(purchRecId);
            this.positionToRecord(purchTable);
        }
    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans