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