I have a list page that is opening with the the last row of the list selected. I am using the SourceTableView property to set the sort order of a column (Due Date) that I also added as a key. The sort order of the records in the column is correct, but for some reason it always opens with the last row of the page selected.
In the documentation, the remarks say:
"When you combine a descending sort order on SourceTableView with overriding the OnFindRecord, you may experience that the page displays the last record instead of the first when the page opens. You can resolve this condition by adding Rec.FindFirst
in the OnOpenPage trigger, or using Find(-)
in the OnFindRecord trigger."
I added a Rec.FindFirst to the OnOpenPage trigger per the recommendation, but the page still loads with the last row selected instead of the top row.
I came across this other thread where another user experienced the same issue, but none of these methods seem to work either.
https://stackoverflow.com/questions/65395797/setascending-business-central-sales-order-list
Thanks for update.
I found some code that was hiding in an OnFindRecord on the page. I modified that to end with Find('-') and now it's working as expected.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156